Created
February 3, 2017 22:20
-
-
Save RobsonAutomator/99c2574a4ab54b78834945230b75e3a0 to your computer and use it in GitHub Desktop.
export-custom-user-properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$property = @( | |
@{Name='Email';Expression={ $PSItem.Profile.GetCustomProperty('Email') }}, | |
@{Name='FirstName';Expression={ $PSItem.Profile.GetCustomProperty('FirstName') }}, | |
@{Name='LastName';Expression={ $PSItem.Profile.GetCustomProperty('LastName') }}, | |
@{Name='Title';Expression={ $PSItem.Profile.GetCustomProperty('Title') }}, | |
@{Name='Company';Expression={ $PSItem.Profile.GetCustomProperty('Company') }}, | |
@{Name='Country';Expression={ $PSItem.Profile.GetCustomProperty('Country') }}, | |
@{Name='ZipCode';Expression={ $PSItem.Profile.GetCustomProperty('ZipCode') }}, | |
@{Name='Department';Expression={ $PSItem.Profile.GetCustomProperty('Department') }}, | |
@{Name='Street';Expression={ $PSItem.Profile.GetCustomProperty('Street') }}, | |
@{Name='City';Expression={ $PSItem.Profile.GetCustomProperty('City') }}, | |
@{Name='Phone';Expression={ $PSItem.Profile.GetCustomProperty('Phone') }}, | |
@{Name='Username';Expression={ $PSItem.Profile.GetCustomProperty('Username') }}, | |
) | |
# Gets not disabled extranet users, next select all custome properties and save all properties to CSV file | |
Get-User -Filter 'extranet\*' ` | |
| Where-Object { $_.Profile.State -ne 'Disabled' } ` | |
| Select-Object -Property $property ` | |
| Export-CSV -Path "$apppath\extranet-enabled-uc.csv" -notype -encoding "unicode" | |
Download-File "$apppath\extranet-enabled-uc.csv" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment