Removing Variable-values

In order to remove value-assignments from Variables, the Set-EmdbVariable cmdlet is used together with the ClearValue-parameter. As an alternative, an assignment can be revoked by assigning the value $null via the SetVariable()-method.


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


The following example removes the value-assignment for the Variable "InternalID" for Computer "XP01". The Variable's value is then set to be inherited:


$MyTarget = Get-EmdbComputer "emdb:\rootDSE\Managed Users & Computers\solys.local\Chicago\ITService\Workstations\XP01"

Set-EmdbVariable "InternalID" -Target $MyTarget -ClearValue


The assignment on the object "Managed Users & Computers" is now revoked via the SetVariable()-method:


$MyTarget = Get-EmdbDomain "emdb:\rootDSE\Managed Users & Computers"

$MyVariable = Get-EmdbVariable "InternalID"

$MyTarget.SetVariable($MyVariable, $null)