OneScript Team Blog

A world of automation script samples based on IT Pros' real-world tasks

Microsoft All-In-One Script Framework Sample Release on August 1st

Microsoft All-In-One Script Framework Sample Release on August 1st

  • Comments 1
  • Likes

This is the first release of script samples in Microsoft All-In-One Script Framework.  We bring to you two Office 365 automation script samples, three Windows Server / Windows Client scripts, and three Exchange Server 2010 script samples.   All of these scripts are based on frequently asked IT tasks that our team collected in TechNet forums and Microsoft Support Incidents.  Many customers are asking about these scenarios, so we expect that the script samples can save more time for our worldwide IT Pros.

------------------------------------------------------------

New Office 365 Script Samples

Script to Modify Office 365 Mailbox Permissions (PowerShell)

http://gallery.technet.microsoft.com/scriptcenter/Script-to-Modify-Office-55e2147e 

Description: This script could be used to modify Office 365 mailbox permissions. You can use this script to add or remove mailbox permissions. This script will try to connect Windows PowerShell to Office 365 automatically if the connection is not established.

User Scenarios: In a real world, IT Administrators may want to modify mailbox permissions due to variety of reasons. If an organization has thousands of mailboxes, it’s impossible to modify permissions for these mailboxes one by one. IT administrators do need a script to complete this task.

Acknowledgement:  Thanks Greg Gu for composing the script.  Thanks Dan Rowley (Microsoft Senior Support Escalation Engineer) for submitting the script topic and reviewing the script sample.

 

Script to Get Office 365 Mailbox Folder Permissions (PowerShell)

http://gallery.technet.microsoft.com/scriptcenter/Script-to-Get-Office-365-60e262dc

Description: This script could be used to get Office 365 mailbox folder permissions. It will try to connect Windows PowerShell to Office 365 automatically if the connection is not established.

User Scenarios: In a real world, IT Administrators may want to get mailbox folder permissions due to variety of reasons. If an organization has thousands of mailboxes, it’s impossible to get permissions from these mailboxes one by one. IT administrators need a script to complete this task.

Acknowledgement:  Thanks Greg Gu for composing the script.  Thanks Dan Rowley (Microsoft Senior Support Escalation Engineer) for submitting the script topic and reviewing the script sample.

 

------------------------------------------------------------

New Windows Server / Windows Client Script Samples

image

 

Find user logon duration (PowerShell)

http://gallery.technet.microsoft.com/scriptcenter/Find-user-logon-duration-667b8c48

Description: This script could be used to collect user logon duration from multiple computers. You can also use the data to generate a report. The user logon duration calculation is based on the general algorithm, Logon duration = Logoff date time - Logon date time. This script considers event 4647 as a logoff event and use it for calculating the logon duration.

User Scenarios: In a real world, IT Administrators may need to collect user logon duration from multiple computers. User logon duration data can be useful when IT Administrators are troubleshooting some issues.

Acknowledgement:  Thanks Shuhao Liu for submitting the script idea.  Thanks Greg Gu for composing the script.  Thanks David Everett (Microsoft Senior Support Escalation Engineer) for reviewing the script sample.

 

Script to fix issues described in KB947222 (PowerShell)

http://gallery.technet.microsoft.com/scriptcenter/Script-to-fix-issues-ab9a639d

Description: This Windows PowerShell script will modify the file permission, and fix fix issues described in KB947222.

User Scenarios: When user redirect the Documents folders to network share, the folders name changes back to My Documents as shown in the following figure. This issue can be fixed by denying Read permission to the administrator for the Desktop.ini files on the server. But the customers need to perform steps one by one. It would be great if we have a script to automate this task.

image

Acknowledgement:  Thanks Shaon Shan for submitting the script idea.  Thanks Anders Wang for composing the script.  Thanks Gary Mudgett (Microsoft Support Escalation Engineer) for reviewing the script sample.

 

Prepopulate a batch of user passwords to RODC (PowerShell)

http://gallery.technet.microsoft.com/scriptcenter/Prepopulate-a-batch-of-34e6d0dc

Description: This Windows PowerShell script will prepopulate a batch of user passwords to a specified Read-only Domain Controller. It will leverage the capability of the native command, repadmin. The script will also strictly check the parameters for avoiding any potential human error.

image

User Scenarios: Currently, IT Professionals can only prepopulate user password for one account each time.  If IT Professionals have to prepopulate 200 or more user passwords within a very short period of time, the job will turn out to be very stressful and tedious.

Acknowledgement:  Thanks Arthur Li for submitting the script idea.  Thanks Greg Gu for composing the script.  Thanks Justin Turner (Microsoft Senior Support Escalation Engineer) for reviewing the script sample.

 

------------------------------------------------------------

New Exchange Server Script Samples

image

 

Get Mailbox and Mailbox Database Statistics in Microsoft Exchange 2010 (PowerShell)

http://gallery.technet.microsoft.com/scriptcenter/Get-Mailbox-and-Mailbox-96915f45

Description: This script could be used to get mailbox and mailbox database statistics in Microsoft Exchange 2010. You can use this script to get different properties based on your needs.

User Scenarios:  In a real world, IT administrators may want to get mailbox and mailbox database statistics for their production environment. In this way, they can closely monitor mailbox size growth and the database growth. They can also use this script for change verification after modifying some properties of mailboxes and mailbox databases.

Acknowledgement:  Thanks Zifeng Wang for submitting the script idea.  Thanks Greg Gu for composing the script.  Thanks Mike Hendrickson (Microsoft Senior Escalation Engineer) for reviewing the script sample.

 

Send Welcome Mail to Each Newly Created Mailbox in Microsoft Exchange 2010 (PowerShell)

http://gallery.technet.microsoft.com/scriptcenter/Send-Welcome-Mail-to-Each-4fff4a93

Description: This script could be used to send welcome mail for each newly created mailbox in Microsoft Exchange 2010. This script allows you to use an .html file as a template. You can use placeholders in this template file. This script allows you to replace these placeholders when the script is being executed.

User Scenarios:  In a real world, IT administrators are always required by human resource department to send welcome mail to each new employee. A welcome mail to a new employee who has accepted your job offer confirms the employee's decision to accept the position. It will save the new employee some feelings of insecurity and avoids misunderstandings.

Acknowledgement:  Thanks Tiger Li for submitting the script idea.  Thanks Greg Gu for composing the script.  Thanks Mike Hendrickson (Microsoft Senior Escalation Engineer) for reviewing the script sample.

 

Collect Event Logs from Microsoft Exchange 2010 Servers (PowerShell)

http://gallery.technet.microsoft.com/scriptcenter/Collect-Event-Logs-from-99633908

Description: This script could be used to collect warning and error events which generated by Microsoft Exchange Server 2010. You can collect these events by Exchange server role.

User Scenarios:  In a real world, IT Administrators need to collect warning and error events for troubleshooting and monitoring the health of Microsoft Exchange 2010. It will be a time-consuming task in a large scale deployment.

Acknowledgement:  Thanks Tiger Li for submitting the script idea.  Thanks Greg Gu for composing the script.  Thanks Mike Hendrickson (Microsoft Senior Escalation Engineer) for reviewing the script sample.

 

 

We look forward to learning your feedback and serving you better.  If you have any suggestions, please email All-In-One Script Framework: onescript@microsoft.com.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment