fixed erroneous adding of user in remove function
This commit is contained in:
parent
81898676ed
commit
fa67132086
@ -37,9 +37,9 @@ if($null -eq $User){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($PSBoundParameters.ContainsKey("Server")){
|
if($PSBoundParameters.ContainsKey("Server")){
|
||||||
$Group = . .\GetProjects.ps1 -Server $Server
|
$Group = . .\GetProjects.ps1 -Server $Server -ProjectName $ProjectName
|
||||||
} else {
|
} else {
|
||||||
$Group = . .\GetProjects.ps1
|
$Group = . .\GetProjects.ps1 -ProjectName $ProjectName
|
||||||
}
|
}
|
||||||
|
|
||||||
if($null -eq $Group){
|
if($null -eq $Group){
|
||||||
@ -61,7 +61,7 @@ if($null -eq $Group){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($PSBoundParameters.ContainsKey("Server")){
|
if($PSBoundParameters.ContainsKey("Server")){
|
||||||
$targeGroup | ForEach-Object {Add-ADGroupMember -Identity $_ -Members $Identity -Server $Server}
|
$targeGroup | ForEach-Object {Remove-ADGroupMember -Identity $_ -Members $Identity -Server $Server}
|
||||||
} else {
|
} else {
|
||||||
$targeGroup | ForEach-Object {Add-ADGroupMember -Identity $_ -Members $Identity}
|
$targeGroup | ForEach-Object {Remove-ADGroupMember -Identity $_ -Members $Identity}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user