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