Why does the group definition get removed when we do not touch it?
What parameters get passed to Remove-GPPGroupsItem which it cannot resolve?
Repeated run:
PS C:\PSGPPreferences> Set-GPPUser -Name sd -GPOName test -Action Delete -NewName 'aaa' -FullName 'fulln' -Description 'aweso' -AccountDisabled $true -UserMayNotChangePassword $true -Disable $true
The property 'Action' cannot be found on this object. Verify that the property exists and can be set.
At C:\PSGPPreferences\Groups\Set-GPPUser.ps1:159 char:54
+ $InputObject.Properties.Action = switch ($Action) {
+ ~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'changeLogon' cannot be found on this object. Verify that the property exists and can be set.
At C:\PSGPPreferences\Groups\Set-GPPUser.ps1:179 char:21
+ $InputObject.Properties.changeLogon = $null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'noChange' cannot be found on this object. Verify that the property exists and can be set.
At C:\PSGPPreferences\Groups\Set-GPPUser.ps1:185 char:21
+ ... $InputObject.Properties.noChange = $UserMayNotChangePassw ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'newName' cannot be found on this object. Verify that the property exists and can be set.
At C:\PSGPPreferences\Groups\Set-GPPUser.ps1:190 char:17
+ $InputObject.Properties.newName = $NewName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'fullName' cannot be found on this object. Verify that the property exists and can be set.
At C:\Groups\Set-GPPUser.ps1:193 char:17
+ $InputObject.Properties.fullName = $FullName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'description' cannot be found on this object. Verify that the property exists and can be set.
At C:\PSGPPreferences\Groups\Set-GPPUser.ps1:196 char:17
+ $InputObject.Properties.description = $Description
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'acctDisabled' cannot be found on this object. Verify that the property exists and can be set.
At C:\PSGPPreferences\Groups\Set-GPPUser.ps1:199 char:17
+ ... $InputObject.Properties.acctDisabled = $AccountDisabled
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'disabled' cannot be found on this object. Verify that the property exists and can be set.
At C:\PSGPPreferences\Groups\Set-GPPUser.ps1:219 char:13
+ $InputObject.disabled = $Disable
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'image' cannot be found on this object. Verify that the property exists and can be set.
At C:\PSGPPreferences\Groups\Set-GPPUser.ps1:222 char:9
+ $InputObject.image = $InputObject.Properties.action.value__ # ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
Remove-GPPUser : Cannot process argument transformation on parameter 'UID'. Cannot convert null to type "System.Guid".
At C:\PSGPPreferences\Groups\Set-GPPUser.ps1:224 char:70
+ ... ection = Remove-GPPUser -GPPSection $GPPSection -UID $InputObject.uid
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Remove-GPPUser], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Remove-GPPUser
Repeated run:
gets us this:
The user definition WAS there - why did it get deleted too?