OneScript Team Blog

A world of automation script samples based on IT Pros' real-world tasks
  • We are looking forward to receiving your feedback

    Microsoft All-In-One Script Framework was publicly announced four months ago.  For those of us who are working on the project, it is like we gave birth to a baby.  The feedback from many warm-hearted community has changed him for better.  It’s a great joy to watch him grow under our careful guidance.  We take pride in his remarkable potential to serve the world of IT.  

    Today, we open a new channel to closely watch your feedback.   The survey is composed of 9 questions.  We look forward to hearing from you.

     

    image

  • Happy Thanksgiving! Thank you from Microsoft All-In-One Script Framework

    Nov 22 is Thanksgiving in U.S.  This is a holiday where we are thankful for the people and circumstances in our lives.  It is a good time to say thank you.  We are deeply grateful for your supports and helps.  You, our readers, the project authors, the people behind the scenes, the sponsors, and our family and friends, help the project grow.  Nothing is more honorable than a grateful heart.  THANK YOU!

    image

  • Windows 8 and Windows Server 2012 How-do-I Script Sample Videos on Channel 9

    Microsoft All-In-One Script Framework is featured by script samples that address frequently asked IT requests in TechNet forums and Microsoft Support.  In order to give IT Pros an easier, quicker and more enjoyable learning experience of our script samples,  the team is partnering with Microsoft DPE Julie-Anne Arsenault, Chris Caldwell and Jana Butler, and a video creation team lead by Felix Wu and Jianhua Dong, to create 5 to 10 mins’ short HD demonstration videos for selected Windows 8 and Windows Server 2012 script samples.  Thanks to the DPEs’ support, the videos are published on the well-known Microsoft Channel 9 community with a new homepage aggregating all our videos. 

    http://channel9.msdn.com/Blogs/OneScript

    image

     

    After watching the video, you can easily download and learn more details of the script sample by clicking its “Sample Download” link on the page.   Here is one of the videos.

     

    This is a continuous effort.  Microsoft All-In-One Script Framework and the partner teams are committed to this.  You can subscribe to the videos by clicking the “Subscribe to this blog” button in http://channel9.msdn.com/Blogs/OneScript.  We hope to hear your feedback and suggestions and continuously improve the videos to better serve our customers.

    image

  • You vote it; we write it! - Microsoft All-In-One Script Framework

    youvoteitwewriteit

    Microsoft All-In-One Script Framework is an on-going effort in which the Microsoft team writes PowerShell/VBS/T-SQL script samples for IT Pros based on their feedback.   The feedback is collected by the team from Microsoft's TechNet forums, Microsoft’s phone support incidents, as well as other social media and communities based on frequently asked IT tasks.   If an IT task is, for example, asked in more than two TechNet forum threads, the team will consider the task as a potential script topic, and providing a script sample to demonstrate how to ease the task with automation scripts. 

    Since the Microsoft All-In-One Script Framework was launched in August,  the team has collected over 350 script topics.  More than 50 of these script ideas have been turned into the actual script samples published on TechNet Script Repository.   In order to better prioritize the script topics and hear more from customers, All-In-One Script Framework launches the “You vote it; We write it” program today in partnership with TechNet Script Repository.   In this program, the team is going to publicly post the collected script topics.  The IT community can vote for these script topics. The higher the topic is voted, the higher priority will the team offer to write and publish the script sample.  

    Every week, the team will post a batch of script topics for the IT community to vote.   You can follow it by subscribing to the "YouVoteWeWrite” RSS feed or visiting this page.  You simply vote for your beloved or wanted script topics.   The All-In-One Script Framework team will write the script sample for you, free of charge.

     

    Here is the first batch of script topics for you to vote!

     

    Windows 8 and Windows Server 2012 Script Topics

    How to get the current automatic theme color in Windows 8?

    Script to Monitor Scheduled Tasks on a server

     

    Office 365 Script Topics

    O365: Set Calendar Permission in Office 365 Exchange Online

    O365: Set OWA Signature in Office 365 Exchange Online

    O365: Add Birthday or Anniversary Reminder in Office 365 Exchange Online

    O365: Export Distribution Group Members in Office 365 Exchange Online

    O365: Remove Duplicated Contacts in Office 365 Exchange Online

    O365: Operate Connected Email Account

  • Microsoft All-In-One Script Framework Sample Release on October 15th

    Microsoft All-In-One Script Framework is updated today with 7 new SQL Server script samples.   The scripts are written for solving frequently asked IT tasks that our team observed in the SQL Server TechNet forums and Microsoft Support Incidents.  Many customers are asking about these IT scenarios, so we expect that the script samples can save some time for IT Pros.

     

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

    SQL Server Script Samples

    image

     

    Enroll SQL Server instances on multi server into an existing SQL Server Utility

    Download: enrollinstances.zip

    http://gallery.technet.microsoft.com/scriptcenter/Enroll-SQL-Server-66687842

    Description: This PowerShell sample script is used to enroll SQL Server instances on multi server into an existing SQL Server Utility. This script applies to SQL Server 2008 R2 and SQL Server 2012 editions.

    User Scenarios: SQL Server Utility can manage the SQL Server environment as a whole through the concept of application and multiserver management in it, so after created one utility control point, administrator need to enroll instances of SQL Server into the SQL Server Utility. If your task included in below two scenarios, this script will be one good assistant.

    • There are multiple managed instances need to be enrolled tothe SQL Server Utility.
    • We can store the server and instance names in one .txt file.

    Acknowledgement: Thanks Stephanie Lv for collecting the script idea.  Thanks Sharp Wang for producing the script sample. 

     

    Check SQL Server missing KB2277078 to prevent leak of security audit entries

    Download: CheckSQLInstanceVersionNumber.zip

    http://gallery.technet.microsoft.com/scriptcenter/Check-SQL-Server-missing-ac29a3ed

    Description: This script will demo how to check SQL Server missing update KB2277078 to prevent leak of security audit entries in TokenAndPermUserStore.

    User Scenarios: When we create and enable a SQL Server audit on a computer that is running Microsoft SQL Server 2008 R2 or Microsoft SQL Server 2008, the TokenAndPermUserStore cache store continues to grow in size. Additionally, the size does not decrease even when we run the DBCC FREESYSTEMCACHE command, this issue occurs because a memory leak occurs when a SQL Server audit is enabled on an object. To fix it, for different versions, we should install the corresponding updates.

      Acknowledgement: Thanks Sharp Wang for collecting the script idea and producing the script sample.

       

      How to retrieve the top N rows for each group

      Download: TopNRowsofGroup.zip

      http://gallery.technet.microsoft.com/scriptcenter/How-to-retrieve-the-top-N-248cdc67

      Description:  This script illustrates how to retrieve the top N rows for each group. The first solution can be used with SQL Server 2000 and upward versions, the second solution applies to SQL Server 2005 and upward versions with common table expression feature and Row_Number() function.

      User Scenarios:

      For example, there is a sample table that has three columns and eight rows:

      ProductID   CategoryID  UnitPrice

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

      1           1           100

      2           1           25

      3           1           46

      4           1           22

      5           2           11

      6           2           44

      7           2           21

      8           3           15

      If we want to see the three of the most expensive (UnitPrice) products for each category in the table, the expected result should be:

      ProductID   CategoryID  UnitPrice

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

      1           1           100

      3           1           46

      2           1           25

      6           2           44

      7           2           21

      5           2           11

      8           3           15

      Acknowledgement: Thanks Jian Kang for collecting the script idea.  Thanks Sharp Wang for producing the script sample. 

       

      Publish report to Reporting Services in SharePoint Integrated Mode

      Download: PublishReportInIntegratedMode.zip

      http://gallery.technet.microsoft.com/scriptcenter/Publish-report-to-0ca69662

      Description: This VB.NET sample script illustrates how to publish a report from a computer path to Reporting Services in SharePoint integrated mode. This script applies to SQL Server Reporting Services 2008 R2 integrated with SharePoint 2010.

      User Scenarios: Starting from SQL Server 2008 R2, the rs utility is supported against report servers that are configured for SharePoint integrated mode as well as servers configured in native mode. Today, most of the available script samples correspond to the native mode.  This sample script will ease the problems in below two scenarios:

      The report server configured to SharePoint integrated mode.

      The published report use embedded data source or shared data source.

      Acknowledgement: Thanks Challen Fu for collecting the script idea.  Thanks Sharp Wang for producing the script sample. 

       

      Bulk set the Timeout property of the reports that in one specified folder

      Download: bulksetTimeout.zip

      http://gallery.technet.microsoft.com/scriptcenter/Bulk-set-the-Timeout-10dcd062

      Description: This Visual Basic.NET sample script illustrates how to bulk set the Timeout property of the reports that in one specified folder via SSRS web services. This script applies to SQL Server Reporting Services 2005, 2008, 2008 R2 and 2012 versions in native mode.

      User Scenarios: Manually, we can make use of Report Manager to modify the Report Timeout property of the reports one by one, but if we have a lot of reports which need to apply this setting, don't we want to replicate in doing this tedious action? The answer is no, we can author a VB.NET script and save it into a .rss file, then take use of RS utility to execute this script with specified parameters. As a result, we can bulk apply this setting to multiple reports. This script will ease IT profs' work in these two scenarios:

      • Need to set this property for multiple reports
      • These reports organized in the same folder or path

      Acknowledgement: Thanks Bill Lu for collecting the script idea.  Thanks Sharp Wang for producing the script sample. 

       

      Add one user/group to a specified Reporting Services item

      Download: addpolicy.zip

      http://gallery.technet.microsoft.com/scriptcenter/Add-one-usergroup-to-one-59b89695

      Description: This Visual Basic.NET sample script illustrates how to add one user or one group to a SQL Server Reporting Services item by referencing SSRS web services. This script applies to SQL Server Reporting Services 2005, 2008, 2008 R2 and 2012 versions in native mode.

      User Scenarios: Add a user or a group and grant certain permission on specify item is one question frequently meet in Reporting Services administration. Traditionally, IT professionals can finish this task in Report Manager web site. Actually, using one rss script with variables can also achieve the same effect as using UI.

        Acknowledgement: Thanks Sharp Wang for collecting the script idea, and producing the script sample. 

         

        Get properties of the objects that in multiple SQL Server instances

        Download: PropertiesOfObjectsInMultipleInstances.zip

        http://gallery.technet.microsoft.com/scriptcenter/Get-properties-of-the-41d810f6

        Description: This Windows PowerShell sample script helps you to get the properties of the objects in multiple SQL Server instances or SQL Server groups.  It applies to SQL Server 2005, SQL Server 2008, SQL Server 2008 R2 and SQL Server 2012.

        User Scenarios: IT administrators frequently ask this question in the TechNet forums: how to get all logins/databases/agent jobs and their properties of multiple SQL Server instances?  In traditional ways, we can write T-SQL query and obtain the expected results one by one.  By using the following script, you can resolve the problems in below scenarios:

        • The objects belong to different instances or SQL Server group.
        • For different object, you would like to obtain the different properties.
        • Output the results in individual files for each object.

        Acknowledgement: Thanks Stephanie Lv for collecting the script idea.  Thanks Sharp Wang for producing the script sample. 

         Script of the Day