How To Use Windows PowerShell To Export Data From Active ...

Back to home
  1. Support Center
  2. FAQs
  3. Integrations
  • Getting Started
  • Configuring SwipedOn
    • Visitors Settings
    • Employees Settings
    • Deliveries Settings
    • Agreements Library
    • Devices
    • Location settings
    • Profile Settings
    • Notifications
    • Security Settings
  • FAQs
    • Employees and Visitors
    • Devices
    • Location Settings
    • Add-Ons FAQs
    • Evacuation and safety
    • Integrations
    • Plans and Pricing
    • Accounts and Billing
    • Hardware
    • Terms of service
    • Troubleshooting
  • Data Protection and Security
  • Visitors
    • Visitors Settings
    • Contactless
    • COVID-19
  • Employees
    • Employee Settings
    • Contactless
  • Add-Ons
    • Deliveries
    • Preboarding
  • SwipedOn Spaces
  • SwipedOn Desks
    • SwipedOn Desks
    • How to guides for SwipedOn Desk Users
    • Administrators
  • Printers and ID labels
    • Printer Settings
    • Brother QL-810W Setup
    • Brother QL-710W Setup
    • Brother QL-820NWB Setup
    • Brother QL-720NW Setup
  • Integrations
    • Active Directory
    • Azure Active Directory
    • Slack
    • Microsoft Teams
Using PowerShell to export from Active Directory to SwipedOn

Guide to use windows powershell to export AD data in order to bulk upload your employees

Below is a short PowerShell script that you can use to export data from Active Directory and import it into your SwipedOn web dashboard.

By using this script, you can export employee records from Active Directory into a neatly formatted CSV file that's ready for upload into our SwipedOn system.

Powershell Script Considerations

  • Export-SwipedOnCSV.ps1.

  • This short script exports contacts from Active Directory into a CSV format suitable for SwipedOn.com.

  • The Select-Object removes '.' from the "first_name" field, or else you will get an "Illegal Character" warning when uploading your CSV.

  • You might have to change the "mobilephone" property in Get-ADUser depending on where you store your phone number values in AD.

Powershell Script

$UsersOU = "OU=Users,OU=YourOU,OU=Somewhere,DC=company,DC=tld"$CSVpath = "\\some\folder\swipedon.csv"Get-ADUser -SearchBase $UsersOU -Filter {Enabled -eq $true} -Properties givenname, surname, emailaddress, mobilephone | Select-Object @{n="first_name";e={($_.givenname).replace(".","")}}, @{n="last_name";e={$_.surname}}, @{n="email";e={$_.emailaddress}}, @{n="phone";e={($_.mobilephone).replace("+","00")}} | Export-Csv -Path $CSVpath -Force -NoTypeInformation -Encoding UTF8

Tag » Active Directory Export Csv Powershell