n1pksI’ve been an information technology professional for over 20 years, with focus on Microsoft and hybrid cloud technologies. I have a bachelor degree in Computer Science and a number of industry certifications including MCSE NT4 and Private Cloud (System Center 2012 R2), MCSA (Server 2012 R2), Hyper-V Specialist, MCTS Exchange 2010, MCTS Lync 2010, Cisco CCNP Data Center, CCNA Data Center & Routing and Switching, CompTIA A+, Network+, VCE-CIA, and a few others..

For published PowerShell scripts and modules in the Microsoft Technet Gallery click here.

Link to my Microsoft profile.

Link to my Linkedin profile.


39 responses

  1. Ginger


    You looks like a SQL powershell Guru . Can you help me . I am new to SQL powershell.

    I want to delete some columns against a table in SQL via powershell I want to make a script and can modify parameters any time to query, update or delete columns against a table

    September 24, 2014 at 7:18 pm

    • Try:
      Import-Module SQLPS
      Invoke-SQLCMD “Declare @stationName nvarchar(100) = ‘test1′”
      Invoke-SQLCMD “Declare @userID uniqueidentifier = (Select users from xtable where Name = @stationName)”
      Invoke-SQLCMD “delete from xtable where Name = @stationName”
      Invoke-SQLCMD “delete from xtables where rowguid = @userID”

      September 25, 2014 at 9:34 am

      • Ginger

        I run this on my test SQL server but I kept getting network connection error

        September 25, 2014 at 1:09 pm

  2. Steve


    Where do I find the StorSimple HCS cmdlets?

    I’ve looked on my local Windows 8.1 and Server 2012 R2 to no avail.

    October 28, 2014 at 7:53 am

  3. Steve,
    The HCS cmdlets are only available on StorSimple 8k physical and virtual appliances which run a version of windows 2012 R2 core OS called “Microsoft Windows Server 2012 R2 Server Cloud Storage”

    October 28, 2014 at 8:55 am

  4. Jürgen

    Hi Sam,

    i Need to run your script “Powershell script to merge VM disks”.
    I have hyper-v Windows 2012 R2 Servers all updates installed

    i run powershell as normal user, as elevated admin, as domain admin …

    i can´t run the script at all.

    i enter the command and nothing happens.

    PS C:\Scripts> .\Merge-VMDisks.ps1 -VMName ‘xxx’
    PS C:\Scripts>

    any idea?

    Thanks in Advance


    March 27, 2015 at 6:59 am

  5. Dave Carroll

    Hi Sam, Just wanted to thank-you for the Get-Images Function, what brilliant piece of powershell! You’ve saved me hours and hours of work sorting photos all the way back to 2003.


    August 9, 2015 at 6:55 am

  6. You’re welcome Dave!

    August 11, 2015 at 9:09 am

  7. Gregory Beckowski


    Have you come across a way to know if a file has been moved out to cloud storage (moved based on tiering rules). When troubleshooting performance related questions it is a key piece of info to have but have not found where this kept.


    November 9, 2015 at 2:55 pm

    • Greg,
      The current tools do not expose this information. However, I have it on good authority that ‘Local Volumes’ feature is coming out this quarter or the next with software update 2. This feature would allow you to pin a volume to a tier. It still won’t show you what tier a file is on, but at least you can put a file on a volume that is pinned to a specific tier.
      More to your question:
      1. Currently tiering happens at the block level. So, a file can have some of its block in SSD tier, some in SAS tier, and some in Azure tier.
      2. Currently tiering is fully automated, and un-configurable. The device will tier to the next tier down as the current tier reaches 84% capacity.
      3. Capacity referred to in #2 above is ‘Device’ Capacity. Device Capacity is actual blocks used on the device after deduplication and compression. Remember that SSD tier is deduplicated, and SAS tier is deduplicated AND compressed. Again we have no visibility or ability to configure deduplication/compression

      November 10, 2015 at 6:53 am

      • Gregory Beckowski

        Thanks Sam.

        November 10, 2015 at 7:23 pm

  8. eric

    Hi Sam,
    Can StorSimple replace a file server such as a VNX? My understanding is that you cant do CIFS/SMB directly on StorSimple?


    February 1, 2016 at 2:29 pm

    • Currently no. StorSimple 8100 and 8600 physical devices as well as the 8010 and 8020 virtual devices are strictly iSCSI SANs.
      However, the new ‘Preview’ OVA (on-prem virtual array) model 1200 can be configured as an SMB file server (NAS) OR iSCSI SAN. See my posts about OVA for more details..

      February 1, 2016 at 5:25 pm

  9. J

    I came across one of your scripts that I’ve found very helpful here in a current project of adding a new admin account to servers from a list. The only problem I have is we need to disable the built in Administrator account from the same list of servers that was imported to add the new accounts. Is there anyway to add that functionality into your script by specifying a -disablelocaluseraccount switch if so desired?:

    February 25, 2016 at 11:47 am

    • Yes, I can add this functionality. Unfortunately, my time is pretty tight right now..

      March 7, 2016 at 9:16 am

      • J

        Nevermind about the above. I figured it out. The only problem with the script is I get errors when it hits 2008 servers on line 198 and 199 Get-CimInstance. The script still looks like it works but throws an error. I guess that call is only for 2012.

        March 10, 2016 at 11:42 am

  10. Gregory Beckowski

    Hi Sam,

    I have something of a basic question about SS functionality and location of data for tiered volumes. What I am trying to understand is if the data in Azure for a tiered SS volume is consistent, meaning is all of the data for that volume that is in the device also in Azure. There is a thought here that if we stop writing to the SS that all of the data that has recently been written to the device, given enough time, will be copied to Azure (Scenario 1). The alternative idea would be that if one were to stop writing to the device that no matter how much time passed, Azure would only contain part of the data with the balance of the data being on the device (Scenario 2). This come into play when trying to understand RTO/RPO capability of the device. Scenario 1 would make Azure a replica of the device (asynch), where Scenario 2 would be basic tiering (only one copy of a block of data exists across all tiers).

    Wanted to get others understanding given we keep going round and round.


    April 12, 2016 at 4:52 pm

    • No. The device does not simply replicate a volume’s data from the SSD/SAS tier to the Azure tier. Scenario 2 is how the device functions – basic tiering at the block level.

      April 13, 2016 at 3:18 pm

  11. Marc Gijsman

    Hi SAM,
    Is there a script\command too link a VMWare datastore with the corresponding StorSimple volume? E.g. when I create 10 StorSimple volumes of 10TB in a volume container and provision them too the Vsphere cluster. How can I see which volume is which datastore??

    Hope you can help me


    July 25, 2016 at 3:29 pm

    • There’s not. This has been one of the things we’re asking Microsoft to provide as an enhancement to the current StorSimple software.
      Restated, StorSimple software currently (29 July 2016) does not provide a LUN ID when provisioning a StorSimple iSCSI volume. So, there’s no way to directly correlate a StorSimple volume as it appears in the StorSimple Azure management interface, to one that appears (unmasked) in a host.
      The current recommendation is to provision your volumes one at a time, format at the host, and use a volume label at the host that matches the one assigned in the StorSimple software.
      Similar recommendations apply when cloning volumes for data recovery..

      July 29, 2016 at 6:39 am

  12. archana

    Hi Sam,

    To which extend StorSimple is recommended when it comes to SQL DB backup.

    I am just trying to analyse the possibility of Changing the StorSimple 7k Appliance.

    August 2, 2016 at 6:18 am

    • Yes, you can safely use StorSimple to store SQL .bak files. You’ll need to examine your RPO, RTO, SLA for your SQL workloads to integrate your SQL maintenance plan schedule with your StorSimple Backup Policy and its schedules.

      August 5, 2016 at 8:17 am

  13. Quentin McCallum

    Get-PII looks to be the tool I need. Nice work.

    I popped a SSN like number in a TXT, XLSX and DOCX file. GET-PII found only the TXT.

    PS C:\Users\***********\Downloads\get-pii> get-pii -TargetFolder “U:\audit” -FileType “docx”
    Searching for files with docx extension on folder U:\audit and its subfolders
    No files found with PII in files with extension(s): ‘docx’ in folder(s) ‘U:\audit’

    PS C:\Users\*************\Downloads\get-pii> Get-ChildItem “U:\audit”

    Directory: U:\audit

    Mode LastWriteTime Length Name
    —- ————- —— —-
    -a— 8/11/2016 10:31 AM *******.mpp
    -a— 8/11/2016 10:31 AM *****.mpp
    -a— 8/12/2016 3:47 PM *********.mpp
    -a— 8/9/2016 3:45 PM ************* Review
    -a— 8/17/2016 11:05 AM 13119 ssn-test.docx
    -a— 8/17/2016 11:04 AM 8842 ssn-test.xlsx
    -a— 8/17/2016 10:19 AM 17 test1.txt

    Any ideas?

    Thanks, in advance, for your help.

    August 17, 2016 at 1:53 pm

  14. Hi Sam,

    I’ve recently started using a StorSimple 8600, running software version 1.2.

    We have several azure subscriptions and unfortunately it seems that when we created the StorSimple manager to register the device it was on the wrong subscription.
    Do you know of any way of updating the registration key directly on the device or is it going to involve a full reinstall via serial cable?

    The device hasn’t had any volumes created apart from one or two that were initial test, so if an update to move subscription could be accomplished but the linked volume containers are lost it would not be a big deal at this point.

    Thanks for any input you can provide 🙂

    October 12, 2016 at 3:51 am

  15. Thanks Sam,

    I was fairly sure that would be the outcome but thought it best to check.
    I noticed in a MS KB article that they mention resetting the controller 0 data0 settings separately, if this is the case can I clarify that resetting to factory settings would retain the ability to connect to the StorSimple via PowerShell over HTTP?

    October 12, 2016 at 4:53 am

    • No. Once the device is factory reset, it must be configured via the serial interface. It cannot be accessed via PowerShell until after serial configuration, device registration, and enabling PowerShell access in the Azure Portal..

      October 12, 2016 at 5:19 am

  16. Hi Sam,

    Thanks for your help, I’ve followed a number of your posts and have found them to be far better than the Microsoft documentation.

    On quick question however, as it seems to contradict a point you make in the “StorSimple Software update 3.0 (17759)” post.
    When applying the maintenance mode updates you mention that you can monitor the update progress before moving to the next controller by using Get-HcsUpdateStatus – however when I run this while in maintenance mode and the updates are running I get the following text with the update status “WARNING: Warning: In maintenance mode, the updates and hotfixes occurring on the peer controller will not be reported by this cmdlet.”.

    The status shows false but I’m a little hesitant to disconnect the serial adapter and move to the next controller as I’m not 100% sure that the update has finished.

    Any thoughts?

    October 13, 2016 at 11:37 am

    • Maintenance mode updates apply to one controller, then the controller reboots, and the updates apply to the other controller. To see update progress, switch to the controller running the update..

      October 13, 2016 at 5:03 pm

  17. Jan

    Hello Sam,

    i have some special question. Do you know any way to get access to the Bios ? I know that it`s possible because in a case support enable the Onboard BMC modules.

    March 8, 2017 at 11:36 pm

    • Hi Jan,
      I assume you’re talking about StorSimple 8k devices. No, currently access to the BIOS is not exposed in the short list of PowerShell cmdlets available to the client (without entering into Support Mode that requires the Microsoft decryption tool). However, we can see hardware status of many of the device components in the Azure classic portal under the device Maintenance link/page under Hardware Status section..

      March 9, 2017 at 5:04 am

  18. Hello Sam,
    I’m definitely a PowerShell newbie…and I’ve read some of your material on PowerShell, parsing robocopy logs and creating a .CSV based upon that output.
    What I’m trying to do is to run a PowerShell command which can call a list of network locations which have robocopy logs in them. Then parse all of those logs for failed robocopy transfers and lastly create output to a network location in a CSV file for only failures.
    I wish I was well trained enough to do this but I’m wondering if you could point me in the right direction?!?!
    Any assistance would be helpful.

    Thank you,

    April 21, 2017 at 10:00 am

  19. whitetig

    Sorry for the disturbing you but i have issue that i think you might be able to assist me with. I have been hacked by someone that is very efficient in many different areas in of XML, XSL, MOF, INF, DLL’s, and Schema’s, Windows Packages and much more. he/she invaded my computer and pretty much rewrote the system to do what ever they would like to do. I am powerless to do anything about it. i have been reading a lot about XML, PS1, I was a Programmer?Network Admin for a company but been out of that for sometime now and very rusty on most things now. Everything i did have has been taken and i have not much left but this person will not just go away i have limited my movements, have not really reverted my computer back to the way it was before they invaded me. I do not do any personnel stuff on here any further no banking/ no buying off the net. basically i stalled any kind of use full things i could do with my computers. i have set security in most every area i could but they bypass everything hacked dll’s they log/record every movement monitor me yet i have nothing they could possible need. i do not know much about the migration of windows. i download programs to get a better understanding but they swap most programs out for their hacked ones what do you think I could do about it. i have contacted Microsoft Tech support and had one of their tech’s look into my computer and while i had a lot of what these people were doing all documented and while i was working on it that tech deleted more then 8 weeks of my hard work gathering all the information on them. they offered me many fringed benefits Free Tech support but as it stands i am not receiving anything much from them at all in any kind of assistance. Is their anything that you could suggest. or assist me with. my system’s are useless as they are. as i can not install a new system since they have hard coded my devices so when i reinstall a new system it just goes and retrieves the SAME HACKED system and i am back to square one again. it doesn’t even install the OS from CD/ USB it just auto-connects to their system and sets up windows from their. I would really like to send them something destructive back to them erasing all their drives/backup/entire network i have more of their files installed on my system then windows has in their entire OS. anyways i have much more but limited space in these relay forms.

    May 3, 2017 at 1:33 am

  20. Lorenzo


    Thank you for the StorSimple script that emails you backup stats for the week, it was working beautifully ! I transitioned our StorSimple unit to the new ARM portal and now the script returns zero results each week. Would you be able to provide an update for the script or instructions of how to fix this so that we can continue to get results. Any help would be greatly appreciated.

    January 4, 2018 at 1:20 pm

  21. I can’t redirect “expand-json” to a file? I’ve tried, >, >>, |outfile and I can’t seem to get the data from expand json to write to disk?

    June 19, 2019 at 11:19 am

    • Axel, I’ve updated this function to allow logging the output to disk. Please download the latest version of the AZSBTools module:
      Remove-Module AZSBTools -Force -EA 0
      Install-Module AZSBTools -Force -AllowClobber

      June 20, 2019 at 7:41 am

  22. Heya just wanted to give you a quick heads up and let you know a few of the images aren’t loading correctly. I’m not sure why but I think its a linking issue. I’ve tried it in two different browsers and both show the same results.

    April 8, 2020 at 1:43 pm

  23. Superb blog you have here but I was curious about if you knew of any community forums that cover the same topics talked about here? I’d really love to be a part of group where I can get opinions from other knowledgeable individuals that share the same interest. If you have any recommendations, please let me know. Appreciate it!

    April 9, 2020 at 9:06 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.