I have a requirement to create a text file containing Exchange Database information in the following format:
Indentity:size Indentity:size
so this would look like
DBase01: 1234 Dbase02: 4321
I have a script the outputs the data in the format
DBase01: 1234
Dbase02: 4321
I am a little stuck on how to do this: script is below, any help would be appreciated. For info, this is to create data that Cacti will accept to graph the data:
------------------------------------------------------------------------------------------------------------------
# Get all the Mailbox servers $colon = ":"ForEach ($server in Get-MailboxServer){ # For each Mailbox server, get all the databases on it $strDB = Get-MailboxDatabase -Server $server # For each Database, get the information from it ForEach ($objItem in $strDB) { $intUsers = ($objitem | Get-Mailbox -ResultSize Unlimited).count $strDBsize = Get-ChildItem $path $ReturnedObj = New-Object PSObject $ReturnedObj | Add-Member NoteProperty -Name "Database" -Value $objItem.name $ReturnedObj | Add-Member NoteProperty -Name "User Count" -Value $intUsers $data = ($ReturnedObj.database + $colon + $ReturnedObj.'User Count') Write-Output $output | FT -HideTableHeaders -AutoSize } }
Thanks
Resolved.
Changed "Write-Output $output | FT -HideTableHeaders -AutoSize" to "Write-host $output -nonewline"