• Launching "Script of the Day" - Learn an amazing IT script sample every 24 hours

     

    image image
    image image

    Every day is an opportunity to learn something or discover something new.  Learn one IT script sample every day; Be an IT master in a year!

    Microsoft All-In-One Script Framework offers "Script of the Day".  "Script of the Day" introduces one amazing script sample every 24 hours that demonstrates the frequently asked IT tasks.  If you are curious about and passionate for learning something new, follow the "Script of the Day” RSS feed or visit the "Script of the Day" homepage, and share your feedback with us onescript@microsoft.com.

     

    image  Subscribe to the RSS Feed: http://blogs.technet.com/b/onescript/rss.aspx?tags=ScriptOfTheDay 

     

  • [Script of Sep 28th] Find user logon duration (PowerShell)

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

    This script can 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. 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.

     

    image image
    image image

    You can find more All-In-One Script Framework script samples at http://aka.ms/onescriptingallery

  • [Script of Sep 29th] SharePoint List Enumerator (PowerShell)

    Script Download: SPListEnumerator.zip

    http://gallery.technet.microsoft.com/scriptcenter/SPListEnumerator-PowerShell-b0ce0b9f

    This script enumerates through a "large" list or document library and provides information about items in it.

    In SharePoint (2007 and 2010) we have a threshold on the number of list items in a container. In SharePoint 2007, the threshold value is 2,000 and in SharePoint 2010, it is 5,000. We often come across customers who have a large number of items in their lists/document libraries and complain of overall site performance. It is possible for customers to create nested folders and have a large number of documents/list items reside in them. But exceeding the threshold value can cause slowness and have a performance impact on the backend SQL content database.

    For example, if you have 500,000 documents stored within folders (and nested folders) in a document library, it becomes difficult to identify specific folders that exceed the threshold value. This script traverses through each folder in a given list/document library and will enumerate items at each container level. It writes the output to a .CSV file to make it easier for viewing in Excel and perform further filtering.

    This PowerShell script and makes use of the SharePoint Object Model. You will have to provide the name of the list or document library that you want to traverse. The
    output is written to an out.CSV file that can be opened in Excel for further filtering of data. The details written include:

    • Parent Name: The container under which the items reside
    • Content Type: The content type of each item
    • No. of Versions (Minor and Major): The total number of versions that exist for the item
    • Size in Bytes (Current Version Only): Applicable only for items in a document library. This column has values to indicate the size of the current version of a document.
    • Breaks Permission Inheritance: Boolean value to indicate if the item breaks permission inheritance
    • Item Count (For Folders Only): The total number of items inside a container

     

    image image
    image

    You can find more All-In-One Script Framework script samples at http://aka.ms/onescriptingallery

  • [Script of Sep 30th] Modify Invalid E-Mail Addresses for Mailbox in Microsoft Exchange 2010

    Script Download: ModifyEmailAddress.zip
    http://gallery.technet.microsoft.com/scriptcenter/Modify-Invalid-E-Mail-e6590197

    This script could be used to remove invalid e-mail addresses for mailbox in Microsoft Exchange 2010. You can find these mailboxes which contains invalid e-mail addresses by using specific string or regular expression.

    In a real world, IT Administrators need to modify the e-mail addresses for mailbox due to following reasons:

    • Addition domain in SMTP Address after migration
    • Wrong design in e-mail address policy
    • Change by accident
    • Some special requests by IT Administrators

    It will be a time-consuming task in a large scale deployment.

     

    image image
    image image

    You can find more All-In-One Script Framework script samples at http://aka.ms/onescriptingallery