Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkbryan/94f1f86c685f1f785b3fc1e7024b324f to your computer and use it in GitHub Desktop.
Save jkbryan/94f1f86c685f1f785b3fc1e7024b324f to your computer and use it in GitHub Desktop.
lithnet-fast-get-ComputedMember-from-input-file.ps1
Import-Module LithnetRMA;
$a=Get-Content "c:\FIMScripts\GroupNames.txt"
ForEach ($i in $a)
{
Write-Host $i
$NameSearch=Search-Resources -XPath "/Group[DisplayName = '$i']/ComputedMember -AttributesToGet @("AccountName")
$Name=$NameSearch.AccountName
# List of samAccountNames written to txt file
$Name>>C:\users\$env:USERNAME\desktop\FIMGroups\$i.txt
$GroupFile=Get-Content C:\users\$env:USERNAME\desktop\FIMGroups\$i.txt | sort-object | Out-File -Filepath C:\users\$env:USERNAME\desktop\FIMGroupsSorted\$i.txt
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment