Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Admodule Get-aduser and get-adobject using csv input file and output to csv SID HISTORY SHOWS Microsoft.ActiveDirectory.Management.ADPropertyValueCollection

$
0
0

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


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>