Jun 12, 2012 at 3:46 PM

I am creating a test/dev environment for SCSM 2012 and only wanted to bring in a subset of users through the AD Connector.  Unfortunately I pulled in 230,000 users and it has overwhelmed my test box. 

I've deleted the connector and now I'm trying to remove the users via Powershell. I found this link:

and it provides this command:

get-scsmobject Microsoft.AD.User$ -Filter "Firstname -eq 'Phil'" | remove-scsmobject -whatif

which seems to be exactly what i want to do. Unfortunately I'm getting this error:

Get-SCSMObject : Cannot bind parameter 'Id'. Cannot convert value "Microsoft.AD.User$" to type "System.Guid". Error: "G
uid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."
At line:1 char:15
+ get-scsmobject <<<<  Microsoft.AD.User$ -Filter "Firstname -eq 'Phil'" | remove-scsmobject -whatif
    + CategoryInfo          : InvalidArgument: (:) [Get-SCSMObject], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,SMLets.GetSMObjectCommand

I'm pretty new to powershell so any help would be appreciated.
Jun 13, 2012 at 8:47 AM
Edited Jun 13, 2012 at 8:48 AM

Hi mate,

try this one:

$UserClass = get-scsmclass -Name Microsoft.AD.User$
get-scsmobject -class $UserClass -Filter "Firstname -eq 'Phil'" | remove-scsmobject -whatif