About


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.

 

33 responses

  1. Ginger

    Sam:

    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

    Sam:

    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

    Jürgen

    March 27, 2015 at 6:59 am

  5. Jurgen, see this post https://superwidgets.wordpress.com/2015/03/28/running-powershell-script-functions/

    March 28, 2015 at 7:35 am

  6. 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.

    Cheers
    Dave

    August 9, 2015 at 6:55 am

  7. You’re welcome Dave!

    August 11, 2015 at 9:09 am

  8. Gregory Beckowski

    Sam,

    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.

    Greg

    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

  9. 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?

    thanks,
    Eric

    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

  10. 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?:
    https://gallery.technet.microsoft.com/scriptcenter/Add-Adminps1-powershell-4cc04875#content

    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

  11. 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.

    Greg

    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

  12. 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

    Marc

    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

  13. 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

  14. 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

  15. 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

    • Jon,
      There’s no way to move a StorSimple device from one subscription to another. You must factory reset the device. See this post https://superwidgets.wordpress.com/2016/01/12/storsimple-8k-series-factory-reset/ for important details.

      October 12, 2016 at 4:21 am

  16. 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

  17. 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

  18. 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..
      Sam

      March 9, 2017 at 5:04 am

  19. 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,
    JBH

    April 21, 2017 at 10:00 am

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s