Thursday, June 27, 2019

Run Powershell commands remotely with PSSession.


Here's a way to run Powershell commands on a remote machine.  It saves the hassle of RDP'ing into the remote machine, wait for Windows to load your profile, run startup scripts, apply GPO settings, load your desktop, etc...  That can be time consuming if you're always logging into to remote machine to verify something.

  1. Create a remote session
    • new-pssession <computer hostname>
  2. Get the ID of the remote session.
    • get-pssession
  3. Connect to that remote session using the ID.
    • enter-pssession <ID>
  4. Once connected, you should see the computer hostname in brackets like below.
    • [computername]: PS C:\users\guest
  5. Execute your Powershell command like so.
    • [computername]: PS C:\users\guest> get-volume
  6. To exit the session, just type the following.
    • exit or exit-pssession
  7. After exiting of the session, you would want to remove/close the session from your computer.
    • remove-pssession <id>
      • Leave me a comment if you know of a way to remove 'all' the sessions at once without looping it in a script.

Hope this helps.

Tuesday, June 25, 2019

Rubrik: Backup, Replication and Disaster Recovery.


Just started looking into Rubrik to backup and DR my work's VM.  In short, Rubrik is a hardware appliance that does VM snapshot backup, replication and DR.  It's fairly straight forward to use and the web console is easy to navigate.  It does replication to a second Rubrik cluster for DR.  So if you want to do replication, you will need 2 appliances. One of their selling point is the Live Mount Recovery feature.  If you're in a scenario to recover a corrupted production VM, Live Mount Recover can mount the Rubrik device as a datastore on your ESX host and power on the VM directly.  This will provided you with minimal downtime from the traditional VM restore.  It also backs up physical machines granted you install their agent.  The agent will allow you to pick and choose what files you want to back up, but the downside to that is this agent backs up on a file level.  So no System State backups or bare metal restores.  Rubrik uses a SLA policy driven to do backups and archive.  You can create as many SLA policies you want and within each of those policies, you can specify when to do snapshots, how often to do it and how many snapshots to retain.   It's very granular in terms of snapshot flexibility.  Since Rubrik is a bit new to the scene, there are some functionality that it does not provide.  I'm hoping they are working on adding these features in for future releases.   Below are some of the pro's and con's.  Note that some of the current missing feature sets mentioned here might be available on the latest release or by the time you've read this.  But my recommendations before you jump into Rubrik is to also look at their direct competitor.

Rubrik Hardware
Rubrik device mounted on the rack.  This 2U 'Brik' has 4 nodes.








Rubrik Hardware
Front Bezel Removed.







Pros
  •    Live mount recovery/Instant Recovery.  Can automatically mount the Rubrik device as a datastore in ESX and run VM's off it.
  •     VM backups and replication
  •     SQL db backups (with an agent installed)
  •     Very granular SLA's and retention
  •     Archive to cloud from SLA's
  •     Granular file/search and recovery within a VM
  •     Scalable.  You can add more nodes to the cluster for more space capacity.
  •     End to end encryption (at rest and in transit)
  •     Good granular reporting.
  •     RBAC permissions.
  •     Hardware and Software solution.  Nothing else you need to buy.
  •     Deduplication

Cons

  •      No active directory object level backups
  •      No system state backups.
  •     Web console difficult to navigate.  We found its difficult to see if a job has failed without doing a report.  They tend to want you to search by VM to determine if a VM has failed to back up.
  •      Weak audit logging.  No way to tell if someone modified a job.  
  •     Pricey compared to its competitors, maybe 2x pricey.  Mostly software and maintenance cost.
  •      vSphere level snapshot backups.  Can be problematic if you have a vm with a large virtual disk as large snapshots can take time creating snapshot and cleaning up snapshots.