I am trying to figure out the best way to do this, and the only thing I can think of is merging two tables into one.
the task
Export following information for ALL AD users: Name, DN, TSAllowLogon.
For all users that have a mailbox, I also want to export the mailbox size.
All this information needs to be in a single table.
I am running on a Server and Exchange 2003, installed powershell 2 and QAD.
Script so far:
The idea is to do a loop, where it will match the DN between mailboxes and users, and then gather the infomation in a single table.
I have no idea how this is suppose to work, and I wouldn't be surprised if anyone had a better idea.
I'm not so good at this, so any input is appreciated!
the task
Export following information for ALL AD users: Name, DN, TSAllowLogon.
For all users that have a mailbox, I also want to export the mailbox size.
All this information needs to be in a single table.
I am running on a Server and Exchange 2003, installed powershell 2 and QAD.
Script so far:
Code:
$date = get-date -uformat %d/%m/%Y
$MB = Get-Wmiobject -namespace root\MicrosoftExchangeV2 -class Exchange_Mailbox -computer koks-u549ckztx1 | select @{name="MailboxSize";expression={$_.Size}},@{name="DN";expression={(Get-QADUser $_.LegacyDN).DN}}
$AD = get-qaduser | select name,dn,tsallowlogon,@{name="Dato";expression={$date}}
I have no idea how this is suppose to work, and I wouldn't be surprised if anyone had a better idea.
I'm not so good at this, so any input is appreciated!