Jestem dość początkujący w powershell. Nie jestem pewien, co ja tu robię nie tak. Próba wyeksportować wszystkie grupy reklam jednego użytkownika do pliku CSV. Wiem, że to trochę trudne zakodowane, ale ja po prostu staram się zrobić coś prostego.
Import-Module ActiveDirectory
$UserName = “pball“
$ReportPath = “C:\Input\EricsStuff\userADgroups.csv“
Get-ADPrincipalGroupMembership $Username | select name, groupcategory, groupscope | export-CSV C:\Input\EricsStuff\userADgroups.csv
# Export to :
# C:\Input\EricsStuff\userADgroups.csv
W szczególności, błąd polega na :
Get-ADPrincipalGroupMembership : An unspecified error has occurred
At C:\Input\EricsStuff\ExportUserGroups.ps1:7 char:1
+ Get-ADPrincipalGroupMembership $Username | select name, groupcategory ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (pball:ADPrincipal) [Get-ADPrincipalGroupMembership], ADException
+ FullyQualifiedErrorId : ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Management.Commands.GetADPrincipalGroupMemb
ership