Link to home
Start Free TrialLog in
Avatar of Jean-François Guénet
Jean-François GuénetFlag for Canada

asked on

Exchange Powershell Help

How can i retreive only the value "Calendrier" when running this command

[PS] C:\Windows\system32>$FolderPath = Get-MailboxFolderStatistics -Identity sallenpq -FolderScope Calendar | fl FolderP
ath
[PS] C:\Windows\system32>$FolderPath


FolderPath : /Calendrier

Thanks !
Avatar of David Paris Vicente
David Paris Vicente
Flag of Spain image

Copy the code to the notepad, and save the file with an extension PS1.
Example: folderpath.ps1


$FolderPath = Get-MailboxFolderStatistics -Identity sallenpq -FolderScope Calendar | fl FolderPath
write-host $FolderPath

Open in new window


Then run it from the powershell line

Hope it helps
Avatar of Jean-François Guénet

ASKER

No but i need only the value "Calendrier" not "FolderPath : /Calendrier"
Can you explain what you want to accomplish?

Meanwhile take a look on the following code.


get-mailboxfolderstatistics myusername | where {$_.name -match "Inbox|Deleted|Sent|Calendar|Drafts"} | sort-object Name | ft Name, FolderPath, ItemsInFolder, FolderSize -auto

Open in new window

When i run this command

[PS] C:\Windows\system32>$FolderPath = Get-MailboxFolderStatistics -Identity sallenpq -FolderScope Calendar | fl FolderPath

and then run this
[PS] C:\Windows\system32>$FolderPath

i get this value
FolderPath : /Calendrier

I want to trim the value "FolderPath : /Calendrier" to get the value "Calendrier"

Thanks !
$FolderPathTrim=$FolderPath.Trim("FolderPath : /")

[PS] C:\Windows\system32>$FolderPathTrim

Open in new window


let us know if this do the trick.

regards
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks that is what i was looking for