OneScript Team Blog

A world of automation script samples based on IT Pros' real-world tasks
  • What’s New in Script Browser & Script Analyzer 1.2

    The Script Browser and Script Analyzer apps have received nearly 15,000 downloads since they were released half a month ago.  Microsoft PowerShell MVPs provided numerous suggestions to help us improve the apps.   Based on what we have learnt in the past two weeks, today we bring to you the 1.2 update of Script Browser and Script Analyzer.  The team is committed to making the apps useful. Your feedback is very important to us.

    Download Script Browser & Script Analyzer 1.2
    (If you have already installed an earlier version of Script Browser & Script Analyzer, you will get an update notification when you launch Windows PowerShell ISE.)

     

    1. A standalone desktop version of Script Browser

    image 

    In this release, we provide a new standalone desktop version of Script Brower so that non-PowerShell scripters, e.g. SQL/VBS scripters, can also benefit from the browser.

    You can easily configure the Script Browser desktop app and the Script Browser PowerShell ISE plugin to share the favorite samples and downloaded samples.

     

    2. New Cmdlets to manually load Script Browser / Script Analyzer when you need them

    In the past releases, the Script Browser and Script Analyzer plugins are turned on automatically when you start Windows PowerShell ISE.  In this release, you can choose to manually load Script Browser and Script Analyzer into ISE when you need them.  Here is how to do it.

    First, you need to uncheck the following ‘Allow the installer to update Windows PowerShell ISE profile’ option when you install the 1.2 update.  In this way, the Script Browser and Script Analyzer will not be loaded automatically when you start ISE.

    image

    Next, when you need Script Browser / Script Analyzer in the ISE, you can type the following cmdlets to load them:

    • Enable-ScriptBrowser
    • Enable-ScriptAnalyzer

    When you do not need them, you can type these cmdlets:

    • Disable-ScriptBrowser
    • Disable-ScriptAnalyzer

    We even provided a cmdlet for starting the desktop version of Script Browser:

    • Start-ScriptBrowserDesktop

     

    3. Largely improved Script Analyzer rules

    In this release, we figured out a new solution to largely improve the speedof Script Analyzer. 

    We have also fixed all Script Analyzer issues that users have reported.  Please continue sharing your feedback with us.

     

    4. Bug Fixes

    a) Improve the startup speed of Script Browser and Script Analyzer

    b) Fixed a sample rating display issue

     

    We sincerely suggest you give the new Script Browser & Script Analyzer a try (click here to download). If you love what you see in Script Browser & Script Analyzer, please recommend it to your friends and colleagues. If you encounter any problems or have any suggestions for us, please contact us at onescript@microsoft.com. Your precious opinions and comments are more than welcome.

  • Install Script Browser & Script Analyzer from PowerShellGet of WMF 5.0

    The PowerShell team has recently announced PowerShellGet, a new way to discover, install and update PowerShell modules, in the Windows Management Framework 5.0 Preview.   In this blog, you will learn how to install Script Browser & Script Analyzer through the PowerShellGet.

    First, you need to download and install Windows Management Framework 5.0 Preview.

    Next, launch Windows PowerShell ISE, and type the following command into the PowerShell console.  The installation does not require administrator permission because it installs the apps to your current user profile.

    Install-Module ScriptBrowser –Scope CurrentUser

    image

    After the installation, you can enable Script Browser / Script Analyzer in the PowerShell ISE by entering the following cmdlets:

    • Enable-ScriptBrowser
    • Enable-ScriptAnalyzer

    image

   Script of the Day

  • [Script of May 7] Collect Event Logs from Microsoft Exchange 2010 Servers (PowerShell)

    Script Download:  
    The script is available for download in Microsoft Script Browser for Windows PowerShell ISE. You need to install the Script Browser application first, and search for the script sample title.

    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.

    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.

    image image
     image

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

  • [Script of May 13] How to get a user password expiration date in Active Directory (VBScript)

    Script Download:  
    The script is available for download in Microsoft Script Browser for Windows PowerShell ISE. You need to install the Script Browser application first, and search for the script sample title.

    This VBScript shows how to get a user password expiration date in Active Directory.

    Sometime users want to know when their password will expire. This script is to get the date without Active Directory Cmdlet.

    image image
     image

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

  • [Script of May 28] How to check if master key for master database is not encrypted

    Script Download:  
    The script is available for download in Microsoft Script Browser for Windows PowerShell ISE. You need to install the Script Browser application first, and search for the script sample title.

    This script can be used to detect if the database master key is not encrypted by Service Master Key.

    SQL Server uses a hierarchy of keys and certificates when a database is enabled for Transparent Database Encryption [TDE]. At the upper levels of the hierarchy, the Service Master Key [SMK] encrypts the Database Master Key [DMK] for the master database. The Database Master Key [DMK] encrypts and protects the Certificate and Database Encryption Key [DEK] involved in the encryption of the user database. After enabling a user database for TDE, you will be able to remove the SMK encryption of the DMK for the master database. If you restart the SQL Server at this point, the database startup will encounter error 15581 and prevent the database from starting up. In some situations, the LogWriter will hang with a wait_type of WRITE_LOG and prevent any transactions from committing in this database. Even though it is possible to remove the SMK encryption for the master database DMK, it is not recommended to do this. 

    image image
     image

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

  • [Script of May 8] Modify Distribution Group Members in Microsoft Exchange 2010 (PowerShell)

    Script Download:  
    The script is available for download in Microsoft Script Browser for Windows PowerShell ISE. You need to install the Script Browser application first, and search for the script sample title.

    This script could be used to modify distribution group members in Microsoft Exchange 2010. You need use a comma-separated values (CSV) file as input.

    In a real world, IT administrators always need to modify distribution group members due to variety of reasons, like acquisitions, break apart and department reorg. It will be a time-consuming job if IT administrators need to modify the distribution groups one by one.

    image image
     image

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

  • [Script of May 1] How to add drive partitioning conditions in SCCM 2012 SP1

    Script Download: 
    The script is available for download in Microsoft Script Browser for Windows PowerShell ISE. You need to install the Script Browser application first, and search for the script sample title.

    This scripts shows how to add drive partitioning conditions in System Center 2012 Configuration Manager SP1.

    Suppose you are a SCCM administrator of a large company, computers usually have different size of disks. You may want to standardize the size of operating system partition when deploying operating systems. You can achieve this goal by adding conditions to the Format and Partition Disk task sequence steps. But a task sequence, especially a MDT task sequence contains multiple steps that require you to add conditions; it’s not easy to edit the steps in task sequence editor. So you want to use a script to ease your work.

    image image
     image

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