header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Subject: Different Results w/ upgraded AD cmdlets
Prev Next
You are not authorized to post a reply.

Author Messages
valdezdjUser is Offline
Shell Enthusiast
Shell Enthusiast
Posts:65


07/16/2008 2:50 PM  

I have a script that gives me the names of the computers in AD but when I installed the new version of the quest AD cmdlets its now giving me other columns that I don't want.
Here's my code:

<br />
$systems = Get-QADComputer -SearchRoot 'path' -SizeLimit 10 `<br />
-DontUseDefaultIncludedProperties -IncludedProperties Name -ExcludedProperties adspath -SerializeValues -Name 'DC*'|`<br />
Sort-Object Name</p>
<p>$systems<br />


It always worked before....?
I have it set to only 10 for testing. Any Suggestions? It adds objectclass and adspath columns. I cannot get rid of those.
Thanks.

KarlUser is Offline
New Member
New Member
Posts:9

07/16/2008 2:56 PM  

the next cmdlets seem to be adding some extra information. This is probably a good thing. In powershell if you want to get just a subset of properties its as easy as it is in SQL..

lets say do-something returns objects with 6 properties.. A,B,C,D,E,F
but you only want A E and F

you can simply do

do-something | select A,E,F

So in your sitution just pipe to select-object and type in the names of the properties that you do want.

-Karl

valdezdjUser is Offline
Shell Enthusiast
Shell Enthusiast
Posts:65


07/16/2008 3:05 PM  
Ok that worked but I'm confused on why it didn't work with the AD cmdlet parameters. ??? That'll work for now since I need to finish this before the end of the week. Thanks.
bsonposhUser is Offline
CLI Addict
CLI Addict
Posts:363

07/16/2008 3:11 PM  
adspath is not a property returned from AD... it is the local object that gives you that information so -excluding it doesn't work.

Select is your best bet.

Brandon Shell
----------------
Microsoft Powershell MVP
https://mvp.support.microsoft.com/profile/Brandon
You are not authorized to post a reply.
Forums > Using PowerShell > General PowerShell > Different Results w/ upgraded AD cmdlets



ActiveForums 3.7
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer