SHARE
TWEET

Untitled

a guest Jan 29th, 2013 260 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Import-Module ActiveDirectory
  2. $groups = Get-ADGroup -SearchBase "OU=staff,OU=Auto,OU=Groups,DC=domain,DC=co,DC=uk" -Filter * | Select-Object Name | Where-Object { $_.Name -match ".All" } | Sort Name | Select-Object -ExpandProperty Name
  3. foreach($group in $groups)
  4. {
  5.     Write-Output "<option value=`"$group`">$group</option>"
  6. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top