Here is the list of Error I got trying to run the script.
New-Object : Cannot find type [Softerra.Adaxes.Adsi.Search.DirectorySearcher]: make sure the assembly containing this type is loaded.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:11 char:13
+ $searcher = New-Object "Softerra.Adaxes.Adsi.Search.DirectorySearcher" $NULL, $F ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
Property 'PageSize' cannot be found on this object; make sure it exists and is settable.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:12 char:1
+ $searcher.SearchParameters.PageSize = 500
+ ~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
Property 'SearchScope' cannot be found on this object; make sure it exists and is settable.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:13 char:1
+ $searcher.SearchParameters.SearchScope = "ADS_SCOPE_SUBTREE"
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
Property 'Filter' cannot be found on this object; make sure it exists and is settable.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:14 char:1
+ $searcher.SearchParameters.Filter = "(&(sAMAccountType=805306368)(!employeeID=N\ ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
Property 'ReferralChasing' cannot be found on this object; make sure it exists and is settable.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:15 char:1
+ $searcher.SearchParameters.ReferralChasing = "ADS_CHASE_REFERRALS_NEVER"
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
You cannot call a method on a null-valued expression.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:16 char:33
+ $searcher.SetPropertiesToLoad(@("employeeID"))
+ ~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Property 'VirtualRoot' cannot be found on this object; make sure it exists and is settable.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:17 char:1
+ $searcher.VirtualRoot = $True
+ ~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
You cannot call a method on a null-valued expression.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:19 char:1
+ $result = $searcher.ExecuteSearch()
+ ~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:20 char:1
+ $users = $result.FetchAll()
+ ~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:21 char:1
+ $result.Dispose()
+ ~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Send-MailMessage : The specified string is not in the form required for an e-mail address.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:72 char:1
+ Send-MailMessage -To $to -from $from -SmtpServer $smtpServer -Subject $subject - ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [Send-MailMessage], FormatException
+ FullyQualifiedErrorId : FormatException,Microsoft.PowerShell.Commands.SendMailMessage
Send-MailMessage : A recipient must be specified.
At \\auca-file01\IT\- Documentation -\- Account Administration -\powershell\employee_ID_check.ps1:72 char:1
+ Send-MailMessage -To $to -from $from -SmtpServer $smtpServer -Subject $subject - ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.SendMailMessage