Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting ad users tsallowlogon attribute

Status
Not open for further replies.

kokser

Programmer
Sep 25, 2009
90
DK
As easy as this may sound, I am having some problems with it.
Code:
Get-Wmiobject -namespace root\MicrosoftExchangeV2 -class Exchange_Mailbox -computer koks-u549ckztx1 | Where {($_.MailboxDisplayName -notmatch "System") -and ($_.MailboxDisplayName -notmatch "SMTP")} | select @{Name="Username";expression={$_.MailboxDisplayName}}, @{name="MailboxSize";expression={$_.Size}}, @{name="TS-Adgang";expression={Get-QADUser | select TSAllowLogon}},@{name="DN";expression={(Get-QADUser $_.LegacyDN).DN}}, @{name="Dato";expression={$date}}
The output is useless like this, when I export it to csv the tsallowlogon field is just blank.
I imaging there is some way I can do the same with "get-qaduser | select tsallowlogon" as I have done with "get-qaduser $_.LegacyDN.DN", but I cannot figure out how.

Any ideas?
 
It's actually done exactly the same way:
@{name="TS-Adgang"; expression={(Get-QADUser $_.LegacyDN).TSAllowLogon}}
 
oh, wow, I hadn't realized legacydn could be used for so many things.

Thanks a lot for the help, it works perfect :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top