Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Limited properties with user objects using Get-QADUser

Closed Thread
 
Thread Tools Display Modes
Old 07-11-2007   #1 (permalink)
Kari
Guest
 
Posts: n/a

Limited properties with user objects using Get-QADUser

Hi!

I would need to create list of my users and I was planning to do it with
Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
amount of properties so I can't select Division as one of the properties for
my table (get-qaduser | select-object Name,LogonName,Company,division).

Is there any way to query for the division information on each object in the
pipeline?

I know that Get-QADUser knows the object attribute division because I did a
list on certain users just by querying the following:
get-qaduser -seachroot 'myad.local' -objectattributes
@{company='Example';division='Example'}

Thru WMI or something? ... and if you're willing to help please be specific
because I quite new with PS.
 
Old 07-11-2007   #2 (permalink)
RichS
Guest
 
Posts: n/a

RE: Limited properties with user objects using Get-QADUser

You should be able to do what you want if you use the -IncludeAllProperties
parameter I think
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Kari" wrote:

> Hi!
>
> I would need to create list of my users and I was planning to do it with
> Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
> amount of properties so I can't select Division as one of the properties for
> my table (get-qaduser | select-object Name,LogonName,Company,division).
>
> Is there any way to query for the division information on each object in the
> pipeline?
>
> I know that Get-QADUser knows the object attribute division because I did a
> list on certain users just by querying the following:
> get-qaduser -seachroot 'myad.local' -objectattributes
> @{company='Example';division='Example'}
>
> Thru WMI or something? ... and if you're willing to help please be specific
> because I quite new with PS.

 
Old 07-12-2007   #3 (permalink)
Kari
Guest
 
Posts: n/a

RE: Limited properties with user objects using Get-QADUser

IcludeAllProperties is a parameter for Get-QADUser? It only returns an error
with my console.

PS H:\> Get-QADUser -SearchRoot myad.local/OU' -IncludeAllProperties |
format-list
Get-QADUser : A parameter cannot be found that matches parameter name
'IncludeAllProperties'.
At line:1 char:62
+ Get-QADUser -SearchRoot 'myad.local/OU' -IncludeAllProperties <<<< |
format-list

Am I doing this wrong or do I have an older version of the ActiveRoles
Management Shell for AD (how often it is updated?).

-Kari

"RichS" wrote:

> You should be able to do what you want if you use the -IncludeAllProperties
> parameter I think
> --
> Richard Siddaway
> Please note that all scripts are supplied "as is" and with no warranty
> Blog: http://richardsiddaway.spaces.live.com/
> PowerShell User Group: http://www.get-psuguk.org.uk
>
>
> "Kari" wrote:
>
> > Hi!
> >
> > I would need to create list of my users and I was planning to do it with
> > Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
> > amount of properties so I can't select Division as one of the properties for
> > my table (get-qaduser | select-object Name,LogonName,Company,division).
> >
> > Is there any way to query for the division information on each object in the
> > pipeline?
> >
> > I know that Get-QADUser knows the object attribute division because I did a
> > list on certain users just by querying the following:
> > get-qaduser -seachroot 'myad.local' -objectattributes
> > @{company='Example';division='Example'}
> >
> > Thru WMI or something? ... and if you're willing to help please be specific
> > because I quite new with PS.

 
Old 07-12-2007   #4 (permalink)
Kari
Guest
 
Posts: n/a

RE: Limited properties with user objects using Get-QADUser

I found out that some one else got it working:
http://dmitrysotnikov.wordpress.com/...er-properties/

.... so why can't I?

"Kari" wrote:

> IcludeAllProperties is a parameter for Get-QADUser? It only returns an error
> with my console.
>
> PS H:\> Get-QADUser -SearchRoot myad.local/OU' -IncludeAllProperties |
> format-list
> Get-QADUser : A parameter cannot be found that matches parameter name
> 'IncludeAllProperties'.
> At line:1 char:62
> + Get-QADUser -SearchRoot 'myad.local/OU' -IncludeAllProperties <<<< |
> format-list
>
> Am I doing this wrong or do I have an older version of the ActiveRoles
> Management Shell for AD (how often it is updated?).
>
> -Kari
>
> "RichS" wrote:
>
> > You should be able to do what you want if you use the -IncludeAllProperties
> > parameter I think
> > --
> > Richard Siddaway
> > Please note that all scripts are supplied "as is" and with no warranty
> > Blog: http://richardsiddaway.spaces.live.com/
> > PowerShell User Group: http://www.get-psuguk.org.uk
> >
> >
> > "Kari" wrote:
> >
> > > Hi!
> > >
> > > I would need to create list of my users and I was planning to do it with
> > > Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
> > > amount of properties so I can't select Division as one of the properties for
> > > my table (get-qaduser | select-object Name,LogonName,Company,division).
> > >
> > > Is there any way to query for the division information on each object in the
> > > pipeline?
> > >
> > > I know that Get-QADUser knows the object attribute division because I did a
> > > list on certain users just by querying the following:
> > > get-qaduser -seachroot 'myad.local' -objectattributes
> > > @{company='Example';division='Example'}
> > >
> > > Thru WMI or something? ... and if you're willing to help please be specific
> > > because I quite new with PS.

 
Old 07-13-2007   #5 (permalink)
Dmitry Sotnikov
Guest
 
Posts: n/a

RE: Limited properties with user objects using Get-QADUser

Kari,

Are you sure you need "division" and not "Department"? It could be that the
division attribute is simply not set.

PS C:\> get-qaduser "Dmitry Sotnikov" | select-object
Name,LogonName,Company,Department

Name LogonName Company
Department
---- --------- -------
----------
Dmitry Sotnikov DSotniko Quest Software
BU - CTO

--
Dmitry Sotnikov
http://dmitrysotnikov.wordpress.com


"Kari" wrote:

> I found out that some one else got it working:
> http://dmitrysotnikov.wordpress.com/...er-properties/
>
> ... so why can't I?
>
> "Kari" wrote:
>
> > IcludeAllProperties is a parameter for Get-QADUser? It only returns an error
> > with my console.
> >
> > PS H:\> Get-QADUser -SearchRoot myad.local/OU' -IncludeAllProperties |
> > format-list
> > Get-QADUser : A parameter cannot be found that matches parameter name
> > 'IncludeAllProperties'.
> > At line:1 char:62
> > + Get-QADUser -SearchRoot 'myad.local/OU' -IncludeAllProperties <<<< |
> > format-list
> >
> > Am I doing this wrong or do I have an older version of the ActiveRoles
> > Management Shell for AD (how often it is updated?).
> >
> > -Kari
> >
> > "RichS" wrote:
> >
> > > You should be able to do what you want if you use the -IncludeAllProperties
> > > parameter I think
> > > --
> > > Richard Siddaway
> > > Please note that all scripts are supplied "as is" and with no warranty
> > > Blog: http://richardsiddaway.spaces.live.com/
> > > PowerShell User Group: http://www.get-psuguk.org.uk
> > >
> > >
> > > "Kari" wrote:
> > >
> > > > Hi!
> > > >
> > > > I would need to create list of my users and I was planning to do it with
> > > > Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
> > > > amount of properties so I can't select Division as one of the properties for
> > > > my table (get-qaduser | select-object Name,LogonName,Company,division).
> > > >
> > > > Is there any way to query for the division information on each object in the
> > > > pipeline?
> > > >
> > > > I know that Get-QADUser knows the object attribute division because I did a
> > > > list on certain users just by querying the following:
> > > > get-qaduser -seachroot 'myad.local' -objectattributes
> > > > @{company='Example';division='Example'}
> > > >
> > > > Thru WMI or something? ... and if you're willing to help please be specific
> > > > because I quite new with PS.

 
Old 07-13-2007   #6 (permalink)
Kari
Guest
 
Posts: n/a

RE: Limited properties with user objects using Get-QADUser

I'm sure it is division. We have a IDM software that has been written so that
the division attribute is filled with all the user objects. I double-checked
it with ADSi edit.

Why doesn't the includeallproperties work with my PS?

-K

"Dmitry Sotnikov" wrote:

> Kari,
>
> Are you sure you need "division" and not "Department"? It could be that the
> division attribute is simply not set.
>
> PS C:\> get-qaduser "Dmitry Sotnikov" | select-object
> Name,LogonName,Company,Department
>
> Name LogonName Company
> Department
> ---- --------- -------
> ----------
> Dmitry Sotnikov DSotniko Quest Software
> BU - CTO
>
> --
> Dmitry Sotnikov
> http://dmitrysotnikov.wordpress.com
>
>
> "Kari" wrote:
>
> > I found out that some one else got it working:
> > http://dmitrysotnikov.wordpress.com/...er-properties/
> >
> > ... so why can't I?
> >
> > "Kari" wrote:
> >
> > > IcludeAllProperties is a parameter for Get-QADUser? It only returns an error
> > > with my console.
> > >
> > > PS H:\> Get-QADUser -SearchRoot myad.local/OU' -IncludeAllProperties |
> > > format-list
> > > Get-QADUser : A parameter cannot be found that matches parameter name
> > > 'IncludeAllProperties'.
> > > At line:1 char:62
> > > + Get-QADUser -SearchRoot 'myad.local/OU' -IncludeAllProperties <<<< |
> > > format-list
> > >
> > > Am I doing this wrong or do I have an older version of the ActiveRoles
> > > Management Shell for AD (how often it is updated?).
> > >
> > > -Kari
> > >
> > > "RichS" wrote:
> > >
> > > > You should be able to do what you want if you use the -IncludeAllProperties
> > > > parameter I think
> > > > --
> > > > Richard Siddaway
> > > > Please note that all scripts are supplied "as is" and with no warranty
> > > > Blog: http://richardsiddaway.spaces.live.com/
> > > > PowerShell User Group: http://www.get-psuguk.org.uk
> > > >
> > > >
> > > > "Kari" wrote:
> > > >
> > > > > Hi!
> > > > >
> > > > > I would need to create list of my users and I was planning to do it with
> > > > > Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
> > > > > amount of properties so I can't select Division as one of the properties for
> > > > > my table (get-qaduser | select-object Name,LogonName,Company,division).
> > > > >
> > > > > Is there any way to query for the division information on each object in the
> > > > > pipeline?
> > > > >
> > > > > I know that Get-QADUser knows the object attribute division because I did a
> > > > > list on certain users just by querying the following:
> > > > > get-qaduser -seachroot 'myad.local' -objectattributes
> > > > > @{company='Example';division='Example'}
> > > > >
> > > > > Thru WMI or something? ... and if you're willing to help please be specific
> > > > > because I quite new with PS.

 
Old 07-13-2007   #7 (permalink)
Dmitry Sotnikov
Guest
 
Posts: n/a

RE: Limited properties with user objects using Get-QADUser

Which version of the cmdlets are you using?

Could you run the following to check?

(get-command (get-pssnapin
Quest.ActiveRoles.ADManagement).ModuleName).FileVersionInfo.ProductVersion

Should tell you 1.0.3.249 if you are on the latest version.

--
Dmitry Sotnikov
http://dmitrysotnikov.wordpress.com


"Kari" wrote:

> I'm sure it is division. We have a IDM software that has been written so that
> the division attribute is filled with all the user objects. I double-checked
> it with ADSi edit.
>
> Why doesn't the includeallproperties work with my PS?
>
> -K
>
> "Dmitry Sotnikov" wrote:
>
> > Kari,
> >
> > Are you sure you need "division" and not "Department"? It could be that the
> > division attribute is simply not set.
> >
> > PS C:\> get-qaduser "Dmitry Sotnikov" | select-object
> > Name,LogonName,Company,Department
> >
> > Name LogonName Company
> > Department
> > ---- --------- -------
> > ----------
> > Dmitry Sotnikov DSotniko Quest Software
> > BU - CTO
> >
> > --
> > Dmitry Sotnikov
> > http://dmitrysotnikov.wordpress.com
> >
> >
> > "Kari" wrote:
> >
> > > I found out that some one else got it working:
> > > http://dmitrysotnikov.wordpress.com/...er-properties/
> > >
> > > ... so why can't I?
> > >
> > > "Kari" wrote:
> > >
> > > > IcludeAllProperties is a parameter for Get-QADUser? It only returns an error
> > > > with my console.
> > > >
> > > > PS H:\> Get-QADUser -SearchRoot myad.local/OU' -IncludeAllProperties |
> > > > format-list
> > > > Get-QADUser : A parameter cannot be found that matches parameter name
> > > > 'IncludeAllProperties'.
> > > > At line:1 char:62
> > > > + Get-QADUser -SearchRoot 'myad.local/OU' -IncludeAllProperties <<<< |
> > > > format-list
> > > >
> > > > Am I doing this wrong or do I have an older version of the ActiveRoles
> > > > Management Shell for AD (how often it is updated?).
> > > >
> > > > -Kari
> > > >
> > > > "RichS" wrote:
> > > >
> > > > > You should be able to do what you want if you use the -IncludeAllProperties
> > > > > parameter I think
> > > > > --
> > > > > Richard Siddaway
> > > > > Please note that all scripts are supplied "as is" and with no warranty
> > > > > Blog: http://richardsiddaway.spaces.live.com/
> > > > > PowerShell User Group: http://www.get-psuguk.org.uk
> > > > >
> > > > >
> > > > > "Kari" wrote:
> > > > >
> > > > > > Hi!
> > > > > >
> > > > > > I would need to create list of my users and I was planning to do it with
> > > > > > Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
> > > > > > amount of properties so I can't select Division as one of the properties for
> > > > > > my table (get-qaduser | select-object Name,LogonName,Company,division).
> > > > > >
> > > > > > Is there any way to query for the division information on each object in the
> > > > > > pipeline?
> > > > > >
> > > > > > I know that Get-QADUser knows the object attribute division because I did a
> > > > > > list on certain users just by querying the following:
> > > > > > get-qaduser -seachroot 'myad.local' -objectattributes
> > > > > > @{company='Example';division='Example'}
> > > > > >
> > > > > > Thru WMI or something? ... and if you're willing to help please be specific
> > > > > > because I quite new with PS.

 
Old 07-16-2007   #8 (permalink)
Kari
Guest
 
Posts: n/a

RE: Limited properties with user objects using Get-QADUser

Ok. Now we made some progress. I'm running ver. 1.0.2.191! I'll get the
latest version of the extension and see what happens then.

-Kari

"Dmitry Sotnikov" wrote:

> Which version of the cmdlets are you using?
>
> Could you run the following to check?
>
> (get-command (get-pssnapin
> Quest.ActiveRoles.ADManagement).ModuleName).FileVersionInfo.ProductVersion
>
> Should tell you 1.0.3.249 if you are on the latest version.
>
> --
> Dmitry Sotnikov
> http://dmitrysotnikov.wordpress.com
>
>
> "Kari" wrote:
>
> > I'm sure it is division. We have a IDM software that has been written so that
> > the division attribute is filled with all the user objects. I double-checked
> > it with ADSi edit.
> >
> > Why doesn't the includeallproperties work with my PS?
> >
> > -K
> >
> > "Dmitry Sotnikov" wrote:
> >
> > > Kari,
> > >
> > > Are you sure you need "division" and not "Department"? It could be that the
> > > division attribute is simply not set.
> > >
> > > PS C:\> get-qaduser "Dmitry Sotnikov" | select-object
> > > Name,LogonName,Company,Department
> > >
> > > Name LogonName Company
> > > Department
> > > ---- --------- -------
> > > ----------
> > > Dmitry Sotnikov DSotniko Quest Software
> > > BU - CTO
> > >
> > > --
> > > Dmitry Sotnikov
> > > http://dmitrysotnikov.wordpress.com
> > >
> > >
> > > "Kari" wrote:
> > >
> > > > I found out that some one else got it working:
> > > > http://dmitrysotnikov.wordpress.com/...er-properties/
> > > >
> > > > ... so why can't I?
> > > >
> > > > "Kari" wrote:
> > > >
> > > > > IcludeAllProperties is a parameter for Get-QADUser? It only returns an error
> > > > > with my console.
> > > > >
> > > > > PS H:\> Get-QADUser -SearchRoot myad.local/OU' -IncludeAllProperties |
> > > > > format-list
> > > > > Get-QADUser : A parameter cannot be found that matches parameter name
> > > > > 'IncludeAllProperties'.
> > > > > At line:1 char:62
> > > > > + Get-QADUser -SearchRoot 'myad.local/OU' -IncludeAllProperties <<<< |
> > > > > format-list
> > > > >
> > > > > Am I doing this wrong or do I have an older version of the ActiveRoles
> > > > > Management Shell for AD (how often it is updated?).
> > > > >
> > > > > -Kari
> > > > >
> > > > > "RichS" wrote:
> > > > >
> > > > > > You should be able to do what you want if you use the -IncludeAllProperties
> > > > > > parameter I think
> > > > > > --
> > > > > > Richard Siddaway
> > > > > > Please note that all scripts are supplied "as is" and with no warranty
> > > > > > Blog: http://richardsiddaway.spaces.live.com/
> > > > > > PowerShell User Group: http://www.get-psuguk.org.uk
> > > > > >
> > > > > >
> > > > > > "Kari" wrote:
> > > > > >
> > > > > > > Hi!
> > > > > > >
> > > > > > > I would need to create list of my users and I was planning to do it with
> > > > > > > Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
> > > > > > > amount of properties so I can't select Division as one of the properties for
> > > > > > > my table (get-qaduser | select-object Name,LogonName,Company,division).
> > > > > > >
> > > > > > > Is there any way to query for the division information on each object in the
> > > > > > > pipeline?
> > > > > > >
> > > > > > > I know that Get-QADUser knows the object attribute division because I did a
> > > > > > > list on certain users just by querying the following:
> > > > > > > get-qaduser -seachroot 'myad.local' -objectattributes
> > > > > > > @{company='Example';division='Example'}
> > > > > > >
> > > > > > > Thru WMI or something? ... and if you're willing to help please be specific
> > > > > > > because I quite new with PS.

 
Old 07-16-2007   #9 (permalink)
Kari
Guest
 
Posts: n/a

RE: Limited properties with user objects using Get-QADUser

Uaargh... This is driving me nuts!

I'm trying to query all the user objects in AD but not all of them include
Company and division data. This is what happens:

PS H:\> Get-QADUser -includeallproperties | Select-Object
Name,LogonName,Company,division
Select-Object : Exception getting "Company": "The given key was not present
in the dictionary."
At line:1 char:50
+ Get-QADUser -includeallproperties | Select-Object <<<<
Name,LogonName,Company,division

If I query an object that has these values, there's no problem:
PS H:\> Get-QADUser "testuser" | Select-Object Name,LogonName,Company,division

Name LogonName Company
division
---- --------- -------
--------
Testuser Testuser Model
Division

Name LogonName
division
---- ---------
--------
Guest Guest
Select-Object : Exception getting "Company": "The given key was not present
in the dictionary."
At line:1 char:50
+ Get-QADUser -includeallproperties | Select-Object <<<<
Name,LogonName,Company,division
Administrator Administrator
Select-Object : Exception getting "Company": "The given key was not present
in the dictionary."
At line:1 char:50
+ Get-QADUser -includeallproperties | Select-Object <<<<
Name,LogonName,Company,division

"Kari" wrote:

> Ok. Now we made some progress. I'm running ver. 1.0.2.191! I'll get the
> latest version of the extension and see what happens then.
>
> -Kari
>
> "Dmitry Sotnikov" wrote:
>
> > Which version of the cmdlets are you using?
> >
> > Could you run the following to check?
> >
> > (get-command (get-pssnapin
> > Quest.ActiveRoles.ADManagement).ModuleName).FileVersionInfo.ProductVersion
> >
> > Should tell you 1.0.3.249 if you are on the latest version.
> >
> > --
> > Dmitry Sotnikov
> > http://dmitrysotnikov.wordpress.com
> >
> >
> > "Kari" wrote:
> >
> > > I'm sure it is division. We have a IDM software that has been written so that
> > > the division attribute is filled with all the user objects. I double-checked
> > > it with ADSi edit.
> > >
> > > Why doesn't the includeallproperties work with my PS?
> > >
> > > -K
> > >
> > > "Dmitry Sotnikov" wrote:
> > >
> > > > Kari,
> > > >
> > > > Are you sure you need "division" and not "Department"? It could be that the
> > > > division attribute is simply not set.
> > > >
> > > > PS C:\> get-qaduser "Dmitry Sotnikov" | select-object
> > > > Name,LogonName,Company,Department
> > > >
> > > > Name LogonName Company
> > > > Department
> > > > ---- --------- -------
> > > > ----------
> > > > Dmitry Sotnikov DSotniko Quest Software
> > > > BU - CTO
> > > >
> > > > --
> > > > Dmitry Sotnikov
> > > > http://dmitrysotnikov.wordpress.com
> > > >
> > > >
> > > > "Kari" wrote:
> > > >
> > > > > I found out that some one else got it working:
> > > > > http://dmitrysotnikov.wordpress.com/...er-properties/
> > > > >
> > > > > ... so why can't I?
> > > > >
> > > > > "Kari" wrote:
> > > > >
> > > > > > IcludeAllProperties is a parameter for Get-QADUser? It only returns an error
> > > > > > with my console.
> > > > > >
> > > > > > PS H:\> Get-QADUser -SearchRoot myad.local/OU' -IncludeAllProperties |
> > > > > > format-list
> > > > > > Get-QADUser : A parameter cannot be found that matches parameter name
> > > > > > 'IncludeAllProperties'.
> > > > > > At line:1 char:62
> > > > > > + Get-QADUser -SearchRoot 'myad.local/OU' -IncludeAllProperties <<<< |
> > > > > > format-list
> > > > > >
> > > > > > Am I doing this wrong or do I have an older version of the ActiveRoles
> > > > > > Management Shell for AD (how often it is updated?).
> > > > > >
> > > > > > -Kari
> > > > > >
> > > > > > "RichS" wrote:
> > > > > >
> > > > > > > You should be able to do what you want if you use the -IncludeAllProperties
> > > > > > > parameter I think
> > > > > > > --
> > > > > > > Richard Siddaway
> > > > > > > Please note that all scripts are supplied "as is" and with no warranty
> > > > > > > Blog: http://richardsiddaway.spaces.live.com/
> > > > > > > PowerShell User Group: http://www.get-psuguk.org.uk
> > > > > > >
> > > > > > >
> > > > > > > "Kari" wrote:
> > > > > > >
> > > > > > > > Hi!
> > > > > > > >
> > > > > > > > I would need to create list of my users and I was planning to do it with
> > > > > > > > Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
> > > > > > > > amount of properties so I can't select Division as one of the properties for
> > > > > > > > my table (get-qaduser | select-object Name,LogonName,Company,division).
> > > > > > > >
> > > > > > > > Is there any way to query for the division information on each object in the
> > > > > > > > pipeline?
> > > > > > > >
> > > > > > > > I know that Get-QADUser knows the object attribute division because I did a
> > > > > > > > list on certain users just by querying the following:
> > > > > > > > get-qaduser -seachroot 'myad.local' -objectattributes
> > > > > > > > @{company='Example';division='Example'}
> > > > > > > >
> > > > > > > > Thru WMI or something? ... and if you're willing to help please be specific
> > > > > > > > because I quite new with PS.

 
Old 07-16-2007   #10 (permalink)
/\/\o\/\/ [MVP]
Guest
 
Posts: n/a

RE: Limited properties with user objects using Get-QADUser

As PowerShell as more than enough ADSI power natively without the AD cmdlets

You can also use the native PowerShell method for this that works fine:

Function Get-AdUser ($name) {
(New-Object
System.DirectoryServices.DirectorySearcher("(&(CN=$name)(objectClass=User))")).findone().getdirectoryEntry()
}

PoSH> Get-AdUser foo | Select-Object Name,LogonName,Company,division

Name LogonName
Company divisio
---- ---------
------- -------
{foo} {}
{}

Greetings /\/\o\/\/

"Kari" wrote:

> Uaargh... This is driving me nuts!
>
> I'm trying to query all the user objects in AD but not all of them include
> Company and division data. This is what happens:
>
> PS H:\> Get-QADUser -includeallproperties | Select-Object
> Name,LogonName,Company,division
> Select-Object : Exception getting "Company": "The given key was not present
> in the dictionary."
> At line:1 char:50
> + Get-QADUser -includeallproperties | Select-Object <<<<
> Name,LogonName,Company,division
>
> If I query an object that has these values, there's no problem:
> PS H:\> Get-QADUser "testuser" | Select-Object Name,LogonName,Company,division
>
> Name LogonName Company
> division
> ---- --------- -------
> --------
> Testuser Testuser Model
> Division
>
> Name LogonName
> division
> ---- ---------
> --------
> Guest Guest
> Select-Object : Exception getting "Company": "The given key was not present
> in the dictionary."
> At line:1 char:50
> + Get-QADUser -includeallproperties | Select-Object <<<<
> Name,LogonName,Company,division
> Administrator Administrator
> Select-Object : Exception getting "Company": "The given key was not present
> in the dictionary."
> At line:1 char:50
> + Get-QADUser -includeallproperties | Select-Object <<<<
> Name,LogonName,Company,division
>
> "Kari" wrote:
>
> > Ok. Now we made some progress. I'm running ver. 1.0.2.191! I'll get the
> > latest version of the extension and see what happens then.
> >
> > -Kari
> >
> > "Dmitry Sotnikov" wrote:
> >
> > > Which version of the cmdlets are you using?
> > >
> > > Could you run the following to check?
> > >
> > > (get-command (get-pssnapin
> > > Quest.ActiveRoles.ADManagement).ModuleName).FileVersionInfo.ProductVersion
> > >
> > > Should tell you 1.0.3.249 if you are on the latest version.
> > >
> > > --
> > > Dmitry Sotnikov
> > > http://dmitrysotnikov.wordpress.com
> > >
> > >
> > > "Kari" wrote:
> > >
> > > > I'm sure it is division. We have a IDM software that has been written so that
> > > > the division attribute is filled with all the user objects. I double-checked
> > > > it with ADSi edit.
> > > >
> > > > Why doesn't the includeallproperties work with my PS?
> > > >
> > > > -K
> > > >
> > > > "Dmitry Sotnikov" wrote:
> > > >
> > > > > Kari,
> > > > >
> > > > > Are you sure you need "division" and not "Department"? It could be that the
> > > > > division attribute is simply not set.
> > > > >
> > > > > PS C:\> get-qaduser "Dmitry Sotnikov" | select-object
> > > > > Name,LogonName,Company,Department
> > > > >
> > > > > Name LogonName Company
> > > > > Department
> > > > > ---- --------- -------
> > > > > ----------
> > > > > Dmitry Sotnikov DSotniko Quest Software
> > > > > BU - CTO
> > > > >
> > > > > --
> > > > > Dmitry Sotnikov
> > > > > http://dmitrysotnikov.wordpress.com
> > > > >
> > > > >
> > > > > "Kari" wrote:
> > > > >
> > > > > > I found out that some one else got it working:
> > > > > > http://dmitrysotnikov.wordpress.com/...er-properties/
> > > > > >
> > > > > > ... so why can't I?
> > > > > >
> > > > > > "Kari" wrote:
> > > > > >
> > > > > > > IcludeAllProperties is a parameter for Get-QADUser? It only returns an error
> > > > > > > with my console.
> > > > > > >
> > > > > > > PS H:\> Get-QADUser -SearchRoot myad.local/OU' -IncludeAllProperties |
> > > > > > > format-list
> > > > > > > Get-QADUser : A parameter cannot be found that matches parameter name
> > > > > > > 'IncludeAllProperties'.
> > > > > > > At line:1 char:62
> > > > > > > + Get-QADUser -SearchRoot 'myad.local/OU' -IncludeAllProperties <<<< |
> > > > > > > format-list
> > > > > > >
> > > > > > > Am I doing this wrong or do I have an older version of the ActiveRoles
> > > > > > > Management Shell for AD (how often it is updated?).
> > > > > > >
> > > > > > > -Kari
> > > > > > >
> > > > > > > "RichS" wrote:
> > > > > > >
> > > > > > > > You should be able to do what you want if you use the -IncludeAllProperties
> > > > > > > > parameter I think
> > > > > > > > --
> > > > > > > > Richard Siddaway
> > > > > > > > Please note that all scripts are supplied "as is" and with no warranty
> > > > > > > > Blog: http://richardsiddaway.spaces.live.com/
> > > > > > > > PowerShell User Group: http://www.get-psuguk.org.uk
> > > > > > > >
> > > > > > > >
> > > > > > > > "Kari" wrote:
> > > > > > > >
> > > > > > > > > Hi!
> > > > > > > > >
> > > > > > > > > I would need to create list of my users and I was planning to do it with
> > > > > > > > > Get-QADUser cmdlet. Unfortunately it seems that these objects have limited
> > > > > > > > > amount of properties so I can't select Division as one of the properties for
> > > > > > > > > my table (get-qaduser | select-object Name,LogonName,Company,division).
> > > > > > > > >
> > > > > > > > > Is there any way to query for the division information on each object in the
> > > > > > > > > pipeline?
> > > > > > > > >
> > > > > > > > > I know that Get-QADUser knows the object attribute division because I did a
> > > > > > > > > list on certain users just by querying the following:
> > > > > > > > > get-qaduser -seachroot 'myad.local' -objectattributes
> > > > > > > > > @{company='Example';division='Example'}
> > > > > > > > >
> > > > > > > > > Thru WMI or something? ... and if you're willing to help please be specific
> > > > > > > > > because I quite new with PS.

 
 
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
select-object not returning properties that are objects Jason PowerShell 5 02-04-2008 09:01 AM
get-qaduser to find disabled user Did PowerShell 4 12-31-2007 02:17 AM
Using a function to setup objects properties with scope of script Frank PowerShell 2 04-16-2007 11:45 AM
Info: Can you create your own objects with custom properties. Brandon Shell PowerShell 8 08-28-2006 03:22 PM
Print out arbitrary properties of objects =?Utf-8?B?SkogU3RyZWljaGVyLUJyZW1lcg==?= PowerShell 5 08-01-2006 12:15 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49