parent
a7ceadc6cf
commit
4b26fe07c7
|
@ -10,14 +10,24 @@
|
|||
"users": [
|
||||
|
||||
{
|
||||
"local_admin": ["ws01"],
|
||||
"name": "Alice Lice",
|
||||
"password":"P@ssw0rd789",
|
||||
"password":"bubbles",
|
||||
"groups": [
|
||||
"Employees"
|
||||
]
|
||||
},
|
||||
{
|
||||
"local_admin": ["ws02"],
|
||||
"name": "Bob Ob",
|
||||
"password":"ashley",
|
||||
"groups": [
|
||||
"Employees"
|
||||
]
|
||||
},
|
||||
{
|
||||
"local_admin": ["ws01", "ws02", "dc1"],
|
||||
"name": "Charlie Harlie",
|
||||
"password":"P@ssw0rdABC",
|
||||
"groups": [
|
||||
"Employees"
|
||||
|
|
|
@ -47,10 +47,13 @@ function CreateADUser(){
|
|||
}
|
||||
|
||||
# Add to local admin as needed
|
||||
if ( $userObject.local_admin -eq $True){
|
||||
net localgroup administrators $Global:Domain\$username /add
|
||||
# if ( $userObject.local_admin -eq $True){
|
||||
# net localgroup administrators $Global:Domain\$username /add
|
||||
# }
|
||||
$add_command="net localgroup administrators $Global:Domain\$username /add"
|
||||
foreach ($hostname in $userObject.local_admin){
|
||||
echo "Invoke-Command -Computer $hostname -ScriptBlock { $add_command }" | Invoke-Expression
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function RemoveADUser(){
|
||||
|
|
Loading…
Reference in New Issue