Thursday, September 29, 2016

Powershell for SID from AD Group Name

Problem:

Had an issue with an Active Directory group.  My algorithm needed to specify the SID and all I had was the name of the group.  I needed a quick way to determine the SID.

Solution:

Get-AdGroup -filter {Name -eq "FCJC_Records_Admin"}


Source:

https://technet.microsoft.com/de-de/library/ee617196.aspx

Monday, September 26, 2016

SSL thumbprint with non ANSI characters

Problem:

I was trying to capture the thumbprint from an SSL certificate on an IIS server.  I opened up the properties view and hit the details tab.  They were nice enough to provide a button to copy the thumbprint to the clipboard.  What they neglect to tell you is that it may include some extra characters.  This is no problem until you park it into a config file for use.  Once you try to match that thumbprint against the visible pattern it will never match due to these non-printable characters.


Solution:

Here is the work around:


Step 1:
Copy and paste the thumbprint from clipboard into notepad.exe. 


Step 2:
Select save for the file but do not save just yet!





Step 3:
Change the encoding type to ANSI vice the default UTF-8



Step 4:
Now during the save you will be prompted with the following message:





Step 5:
Select OK and proceed.  This lets you know that the hidden character was present


Step 6:
Completely close notepad. 


Step 7:
Now open up the file with notepad again.  What you will see is the offending characters displayed.
Remove these and then you will have the full thumbprint for the SSL certificate