I am trying to consolidate information after a multidomain migration and am trying to determine which users have not been migrated yet.
I am trying to use the Active Directory Module but I cant get the SID History to show when using a csv as an import file.
If I try using the below with a SamAccountName or DistinguishedName name it works fine. (But only one by one)
Q1. How can I use Get-aduser pr GetADObject with a column in a csv? I know to use import-csv x.csv and then set a variable
such as $test = $._Test to pull in the info.
Q2 The Below gets me all the users in an ou but SidHistory Shows as "
Microsoft.ActiveDirectory.Management.ADPropertyValueCollection" The Problem is if I specify a user with SamAccont and add the sid and sidhistory -property it will show the sidhistory. Why doesn't it do it for an OU dump. Here is the bulk OU dump with no csv input. If I export-csv test.csv it works except the SIDHISTORY field shows microsoft.activedirectory."""" |
Get-ADUser -filter '*' -SearchBase "OU=,OU=Valparaiso,OU=IN,DC=US,DC=chs,DC=net" -Properties Enabled,SamAccountName,SID,SIDHistory,Surname,UserPrincipalName
Here is the kicker for that sidhistory cmdlet out there I can dump in bulk the sidhistory for an ou, but not the sidhistory and the new sid...
In closing I want to be able to export the username sid and sidhistory to a csv file.
PLEASE HELP.
I have been at this for like 7 hours.
Thanks
Rich