Monday, February 6, 2017

SCCM Current Branch: SCCM status icon reference...

Ever wonder what the status icons mean in SCCM? Boy I sure did, so I looked them up. Here you go:

Status icons for software updates:
https://technet.microsoft.com/en-us/library/hh848254.aspx

Status icons for client states:
https://docs.microsoft.com/en-us/sccm/core/clients/manage/monitor-clients

Enjoy!

Friday, September 30, 2016

How to get all components of a Hyper-V VM under a single directory when creating a new VM...

When creating a Hyper-V VM at the "Specify Name" stage make sure you check the box to "Store the virtual machine in a different location". Why? Well let's assume you are at this step, you have the box checked and you have entered the following for the "Name" and "Location" fields:

Name: "My VM Name 001"
Location: "C:\ClusterStorage\volume1\hyper-v\"

In the example above Hyper-V will create a single folder named "My VM Name 001" at location "C:\ClusterStorage\volume1\hyper-v\" and all components of that VM will be contained under that folder (as opposed to having some components at the root of "C:\ClusterStorage\volume1\hyper-v\" and some under a subdirectory named "My VM Name 001" which is the default behavior). This will make your VM's more self-contained and (therefore) easier to administer.

Tuesday, September 6, 2016

Using SysNative to redirect a SCCM Package to use 64-Bit stuff...

Everywhere you go it seems like all the "experts" say to use the Package model (not the Application model) when you want to deploy a script using SCCM. The problem is Packages seem to only be be cable of executing in 32 bit mode (even on 64_bit OSes) because the SCCM client is 32-Bit. Obviously this presents a problem if you ever need to have your script reference anything 64-bit. I did some googling and found a number of solutions out there but (ultimately) found them a bit clunky. So I grabbed the best bits I could found out of all of them and combined them into my own script:

@ECHO OFF & CLS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: SysNative Redirect :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Purpose: SysNative is a virtual folder visible to 32-Bit applications but not :: visible to 64-Bit applications. This script uses SysNative to redirect scripts :: to use native executables on when run on a 64-Bit Operating System. :: Version: 2.1 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: REM Set script filename: SET "_MyScript=%~n0.ps1" REM OS Run architecture check and redirect if needed: If "%PROCESSOR_ARCHITEW6432%"=="" (GOTO :_STANDARD) ELSE (GOTO :_SYSNATIVE) :_SYSNATIVE %WINDIR%\sysnative\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy bypass -file "%~dp0%_MyScript%" REM %WINDIR%\sysnative\cscript.exe "%~dp0myscript.vbs" REM %WINDIR%\sysnative\cmd.exe "%~dp0myscript.cmd" GOTO :_END :_STANDARD powershell.exe -NoProfile -ExecutionPolicy bypass -File "%~dp0%_MyScript%" REM cscript.exe "%~dp0myscript.vbs" REM cmd.exe "%~dp0myscript.cmd" GOTO :_END :_END REM Pause to view results: REM ECHO. REM ECHO Press any key to exit ... REM PAUSE > NUL

To use it just uncomment your script language of choice (while commenting out the ones you don't want), save it as a .CMD file in the same folder with the same name as the script you want to execute and specify the .CMD file as your Command Line. It should handle the rest for you.

Friday, August 19, 2016

Microsoft is changing how Windows Updates work...

This is a very interesting development, not sure how this will affect me yet as an SCCM admin but (on the surface) the idea of them back-porting the Cumulative Update model for Windows 10 to Windows 7/8.1 sounds fantastic. Personally? This time next year I hope to have all Windows 10 clients in my infrastructure anyway but if that doesn't happen then at least this should make supporting older clients much easier:

https://blogs.technet.microsoft.com/windowsitpro/2016/08/15/further-simplifying-servicing-model-for-windows-7-and-windows-8-1/

Does this mean my SUGs will shrink down to a single update per OS?!!! Almost certainly not but we shall see....

Thursday, August 18, 2016

I'm still here!

Apologies for the recent lack of updates. My company is currently undergoing a big reorganization and I'm finding I don't have a lot of free time for new posts. I'm still heavily involved with SCCM administration though and am currently working to roll out Windows 10 v1607 and spinning up a brand new SCCM server to support it. Lots of lessons learned and tons of potential new post ideas are springing from these efforts. Hopefully I can get some new content here soon. In the meantime I have been and am more than happy to answer questions in the comments sections of other posts. Keep those coming guys! Love helping out my fellow admins!

Monday, February 16, 2015

SCCM: Logs to check when troubleshooting application deployment issues

Whenever you run into client side issues with application deployment in SCCM check the exemgr.log file on the client and the log generated by the application you are installing. I've found starting there is the best way to uncover issues with my deployments.

Wednesday, September 10, 2014

The Best Teas I ever had: Kusmi Prince Vladimir

Although I haven't talked about tea much lately my love affair for water infused with camellia sinensis has not diminished in the slightest. To that end I'm going to start a series of posts on "The Best Teas I ever had". I plan to drop a few of them here and there between other posts whenever I get the urge and each one will cover either a favorite tea of mine or a particularly memorable tea drinking experience. So to set the tone why not cover what is probably my current favorite tea of all time, Prince Vladimir by Kusmi Tea. Here's what they say about it on their website:

 "Created in 1888 in honor of Vladimir the Great, ruler of Holy Russia, Prince Vladimir tea is a blend of Earl Grey, citrus, vanilla and spices. It is one of our most unforgettable teas. We suggest to enjoy this tea during the whole day. Main flavor: Smooth citrus and spice." 

Here's a picture of the 8.8 ounce tin (or the large size which is of course what I order every time):

 

I’m a big fan of Kusmi teas, but this remains my constant favorite. Given that this is listed on their site as one of their most popular teas I am not alone in that regard. I can honestly say in all my years of tea tasting I've never experienced a tea quite like Prince Vladimir. From the initial aroma to the final brew, it is a decidedly unique tea. In fact, the first time I opened the canister in the presence of one of my friends and he had a whiff, he asked me if the contents were legal!!! Like most Kusmi teas, the final brew is very smooth with virtually no bitterness and the spices are easily discernible on the palate with or without adding sugar or milk. In my opinion it is the unique nature of this tea that is its most endearing quality (as opposed to the taste alone, which is still quite good). Its always fun keep some on-hand to expose my “non-hot-tea drinking friends” to “something different”. This is just a fun tea, period.

Thursday, May 29, 2014

Adding 'Run as administrator' right-click menu items for VBScript and PowerShell files

One of my post TechEd 2014 resolutions is to finally cast off my Batch script crutches and start running with with PowerShell and/or VBScript. To that end I assigned myself the task of converting a few of my Batch scripts over to these new languages last week. Right away I found myself annoyed. See, the great thing about Batch is you have this nifty "Run as administrator" context menu item that appears when you right-click on any .BAT or .CMD file. If I run a Batch script once with a simple double-click and it fails then I have the right-click option to provide me with a quick and easy way for me to run the script with elevated credentials. This allows me to quickly determine if some aspect of my code requires administrative permissions. I found out real quick that this menu item appears to be missing for .PS1 and .VBS files.

Now I get why Microsoft did this. It’s probably a security measure to prevent you from accidentally hosing your system by running a bunch of scripts in the Administrator context. It’s certainly not a feature I’d want “Joe User” to have access to. Still us more “advanced” users might want to have this menu item present purely to speed up our script testing process. So to solve this little dilemma for myself I put together two Batch scripts (HA, Ha, yes I’m using Batch to ultimately eliminate Batch) to add the right-click options back in for .PS1 and .VBS files. The scripts I wrote are posted below. Note that with the .VBS script you have two options! One uses CSCRIPT.EXE and the other uses WSCRIPT.EXE. If you don’t know the difference then don’t use the scripts. They also come with no warranties! Use at your own risk!


Add Right-click “Run as administrator” for .PS1 files (PowerShell):


@ECHO OFF & CLS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: TITLE Enable right-click 'Run as Admin' for PowerShell for Windows 7 or Later :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Purpose: Add Windows context menu item. :: Version: 2.1 :: Author: ZeusABJ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Display status message: ECHO. ECHO Enabling right-click 'Run as Admin' for PowerShell for Windows 7 or Later... ECHO. :: Add value for UAC shield icon: REG ADD "HKCR\Microsoft.PowerShellScript.1\Shell\runas" /v HasLUAShield /t REG_SZ /d "" /f :: Add value to create context menu item: REG ADD "HKCR\Microsoft.PowerShellScript.1\Shell\runas\command" /ve /t REG_EXPAND_SZ /d "\"%%SYSTEMROOT%%\System32\WindowsPowerShell\v1.0\powershell.exe\" -executionpolicy bypass -nologo -file \"%%1\"" /f :: Display completion notice: ECHO. ECHO Done! :: Delay for processing: PING 127.0.0.1 -n 3 > NUL :: Pause to view results: :: ECHO. :: PAUSE EXIT

Remove Right-click “Run as administrator” for .PS1 files (PowerShell):


@ECHO OFF & CLS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: TITLE Disable right-click 'Run as Admin' for PowerShell for Windows 7 or Later :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Purpose: Remove Windows context menu item. :: Version: 2.1 :: Author: ZeusABJ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Display status message: ECHO. ECHO Disabling right-click 'Run as Admin' for PowerShell for Windows 7 or Later... ECHO. :: Remove custom 'runas' registry entry: REG DELETE "HKCR\Microsoft.PowerShellScript.1\Shell\runas" /f :: Display completion notice: ECHO. ECHO Done! :: Delay for processing: PING 127.0.0.1 -n 3 > NUL :: Pause to view results: :: ECHO. :: PAUSE EXIT

Add Right-click “Run as administrator” for .VBS files (VBScript - WSCRIPT.EXE):


@ECHO OFF & CLS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: TITLE Enable right-click 'Run as Admin' for VBS for Windows 7 or Later (WSCRIPT) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Purpose: Add Windows context menu item. :: Version: 2.0 :: Author: ZeusABJ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Display status message: ECHO Enabling right-click 'Run as Admin' for VBS for Windows 7 or Later (WSCRIPT)... ECHO. :: Add value for UAC shield icon: REG ADD "HKCR\VBSFile\Shell\runas" /v HasLUAShield /t REG_SZ /d "" /f :: Add value to create context menu item: REG ADD "HKCR\VBSFile\Shell\runas\Command" /ve /t REG_EXPAND_SZ /d "\"%%SYSTEMROOT%%\System32\wscript.exe\" \"%%1\" %%*" /f :: Display completion notice: ECHO. ECHO Done! :: Delay for processing: PING 127.0.0.1 -n 3 > NUL :: Pause to view results: :: ECHO. :: PAUSE EXIT

Add Right-click “Run as administrator” for .VBS files (VBScript - CSCRIPT.EXE):


@ECHO OFF & CLS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: TITLE Enable right-click 'Run as Admin' for VBS for Windows 7 or Later (CSCRIPT) :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Purpose: Add Windows context menu item. :: Version: 2.1 :: Author: ZeusABJ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Display status message: ECHO. ECHO Enabling right-click 'Run as Admin' for VBS for Windows 7 or Later (CSCRIPT)... ECHO. :: Add value for UAC shield icon: REG ADD "HKCR\VBSFile\Shell\runas" /v HasLUAShield /t REG_SZ /d "" /f :: Add value to create context menu item: REG ADD "HKCR\VBSFile\Shell\runas\Command" /ve /t REG_EXPAND_SZ /d "\"%%SYSTEMROOT%%\System32\cscript.exe\" \"%%1\" %%*" /f :: Display completion notice: ECHO. ECHO Done! :: Delay for processing: PING 127.0.0.1 -n 3 > NUL :: Pause to view results: :: ECHO. :: PAUSE EXIT

Remove Right-click “Run as administrator” for .VBS files (VBScript):


@ECHO OFF & CLS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: TITLE Disable right-click 'Run as Admin' for VBS for Windows 7 or Later :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Purpose: Remove Windows context menu item. :: Version: 2.1 :: Author: ZeusABJ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Display status message: ECHO. ECHO Disabling right-click 'Run as Administrator' for VBS for Windows 7 or Later... ECHO. :: Remove custom 'runas' registry entry: REG DELETE "HKCR\VBSFile\Shell\runas" /f :: Display completion notice: ECHO. ECHO Done! :: Delay for processing: PING 127.0.0.1 -n 3 > NUL :: Pause to view results: :: ECHO. :: PAUSE EXIT