![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | PowerShell access to AD user Terminal Services attributes I've been looking at using PowerShell to help me manage my users in Active Directory and so far I like everything that I am seeing. I have ran into an issue though where I can not figure out how to access the users' Terminal Services attributes. Here is the command I am using to get the user information from Active Directory: Code Snippet Get-WMIObject -class ds_user -namespace root\directory\ldap -computername . | Select-Object DS_SAMAccountName If I pipe it to Get-Member instead of Select-Object, I see a property called ds_terminalServer but I don't know how to access it (if that is even an option). I am new to PowerShell so I may just be missing something simple or I may be on the completely incorrect path. What I would like to see is when I do a Select-Object, to have a column for the TS Profile Path, one for the TS Home Path, and then one for the TS Home Drive Letter. Thanks in advance for any advice. John |
My System Specs![]() |
| | #2 (permalink) |
| | RE: PowerShell access to AD user Terminal Services attributes More information can be found at bottom of this post on old blog be aware that the wrapper has changed a bit as this in a beta version, you need to add PsObject before the invoke : You can see this is stored in a DirectoryString named userParameters that is not really readable , but again there are special Methods here for setting this in the ADSI COM object you can Use with the invoke function , for a Complete list look here on MSDN : IADsTSUserEx Property MethodsIADsTSUserEx Property Methods http://mow001.blogspot.com/2006/07/p...ry-part-3.html "John Yarborough" wrote: > I've been looking at using PowerShell to help me manage my users in Active > Directory and so far I like everything that I am seeing. I have ran into an > issue though where I can not figure out how to access the users' Terminal > Services attributes. > > > > Here is the command I am using to get the user information from Active > Directory: > > > > > Code Snippet > Get-WMIObject -class ds_user -namespace root\directory\ldap -computername . > | Select-Object DS_SAMAccountName > > > > > > > If I pipe it to Get-Member instead of Select-Object, I see a property called > ds_terminalServer but I don't know how to access it (if that is even an > option). I am new to PowerShell so I may just be missing something simple or > I may be on the completely incorrect path. > > > > What I would like to see is when I do a Select-Object, to have a column for > the TS Profile Path, one for the TS Home Path, and then one for the TS Home > Drive Letter. > > > > Thanks in advance for any advice. > > > > John > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: PowerShell access to AD user Terminal Services attributes On Jul 12, 10:50 am, John Yarborough > Code Snippet > Get-WMIObject -class ds_user -namespace root\directory\ldap -computername . > | Select-Object DS_SAMAccountName > > If I pipe it to Get-Member instead of Select-Object, I see a property called > ds_terminalServer but I don't know how to access it (if that is even an > option). Note this from the select-object help file: "If you use Select-Object to select specified properties, it copies the values of those properties from the input objects and creates new objects that have the specified properties and copied values." What this means is that instead of a WMI object with certain methods and properties, you've created a new custom object that only has the bits you've chosen. What you need to do is perform your operations on the WMI object itself. Easiest way to do this is like so: # $theusers = get-wmiobject -class ds_user -namespace root\directory \ldap Then access the properties using the "." operator: # $theusers.DS_SAMAccountName Also read the help files about_objects and about_properties. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Allow Log In Terminal Services | .NET General | |||
| Terminal Services Client-Citrix access without disabling UAC | Vista General | |||
| Terminal Services | Vista General | |||
| Access web services through powershell | PowerShell | |||