Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $var_computer = @{
- "Notebooks" = "NB";
- "PCs" = "PC";
- }
- $var_os = @{
- "Windows10" = "Windows 10*";
- "Windows8.1" = "Windows 8.1*";
- }
- function create_groups ($var_computer, $var_os, $path){
- ForEach ($key in ($computer_mappings).Keys) {
- $new_group_name = "_DEFAULT_" + $key
- if ((Get-ADGroup -Filter {Name -eq $new_group_name} -SearchBase $path) -eq $null) {
- New-ADGroup -name $new_group_name -GroupScope Global -Path $path
- }
Add Comment
Please, Sign In to add comment