My employer has provided to my team free powershell training to anyone who wanted it. Though I have been doing powershell scripts for over a year now, there were a few elements I had not learned through my self study.
1) When typing in properties to a cmdlet, you only need to type enough of the property to distinguish it from other properties.
get-mailbox -identity eric.woodford -organizationalunit "MyUsers OU"
Can be shortened to:
mailbox eric.woodford -org "MyUsers OU"
Where:
- Mailbox is an alias for "get-mailbox"
- -identity doesn't need to be specified because it is in the #1 location
- -org can be shortened because of the distinction. (maybe even shorter haven't tested)
2) There are a number of "Environmental" variables that are available to modify.
- $home - points to your home folder
- $profile - settings defined in your startup profile
- $exscripts - points to the Exchange Scripts folder on the server.
3) The microsoft scripts folder contains "2" variants that are slight modifications of other scripts that go across all servers. To name a few (need to find notes to get exact names):
- msg tracking logs across all servers
- server health
4) Need to look into this get-help command further. Teacher used a switch called -role to filter cmdlets back. For example:
get-help -role "mailbox"
returns all cmdlets that are anything related to Exchange 2007 mailbox management.
get-help -functional "organization"
returns cmdlets that relate to the top level of Exchange management.
Comments
Post new comment