ich ein Skript zu erstellen Ich versuche, die die oben tun,anzeigen Alle Behinderten ADUsers und ihre ADGROUP Mitgliedschaft
Ich habe so etwas wie das:
Search-ADAccount -AccountDisabled | Export-Csv -Path C:\csv\DisabledUsers.csv -NoTypeInformation
$csv = Import-Csv -Path c:\csv\DisabledUsers.csv
foreach ($SamAccountName in $csv)
{
Get-ADPrincipalGroupMembership | format table | Export-Csv -Path C:\csv\DisabledUsersGroupM.csv -NoTypeInformation
}
Es ist gut funktionieren, bis der foreach
Teil. Scheint so, als würden keine Werte aus der CSV importiert.
ich dieses:
cmdlet Get-ADPrincipalGroupMembership at command pipeline position Supply values for the following parameters: (Type !? for Help.) Identity:
Was mache ich falsch?