I want to assign a null value to a variable called $dec
, but it gives me errors. Here is my code:
import-module activedirectory
$domain = "domain.example.com"
$dec = null
Get-ADComputer -Filter {Description -eq $dec}
I want to assign a null value to a variable called $dec
, but it gives me errors. Here is my code:
import-module activedirectory
$domain = "domain.example.com"
$dec = null
Get-ADComputer -Filter {Description -eq $dec}
These are automatic variables, like
$null
,$true
,$false
etc.about_Automatic_Variables
, see https://technet.microsoft.com/en-us/library/hh847768.aspx?f=255&MSPPError=-2147217396Use
$dec = $null
From the documentation:
If the goal simply is to list all computer objects with an empty description attribute try this