Guest User

Untitled

a guest
Mar 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. $var_computer = @{
  2. "Notebooks" = "NB";
  3. "PCs" = "PC";
  4. }
  5.  
  6. $var_os = @{
  7. "Windows10" = "Windows 10*";
  8. "Windows8.1" = "Windows 8.1*";
  9. }
  10.  
  11. function create_groups ($var_computer, $var_os, $path){
  12. ForEach ($key in ($computer_mappings).Keys) {
  13. $new_group_name = "_DEFAULT_" + $key
  14. if ((Get-ADGroup -Filter {Name -eq $new_group_name} -SearchBase $path) -eq $null) {
  15. New-ADGroup -name $new_group_name -GroupScope Global -Path $path
  16. }
Add Comment
Please, Sign In to add comment