Tuesday, April 28, 2015

Enabling TPM on HP Zbook and Elitebook laptops

Ran into an issue this Am with trying to enable TPM or Trusted Platform Module on a new Zbook from HP.  If you hit ESC then BIOS Options, then Security you will see that TPM, User Management and a few other options are greyed out.  Turns out you must set a BIOS Password in order to change those options.

Stupid move HP but whatever I guess, at least now I can encrypt the drive.

Wednesday, April 22, 2015

Backup and recover Vmware ESXi installs on SD cards

Here's a small piece on teh backing up and restoring of vmware 'firmware' most often used when running the hypervisor off SD cards.


Using the Vcenter-CLI:

Get-VmHostFirmware -Vmhost x.x.x.x -backupconfiguration -destinationpath c:\users\blah

Restoring:

Set-VmHostFirmware -Vmhost x.x.x.x -restore -sourcepath c:\users\blah\configbundle-<vmhost ip>.tgz -HostUser root -HostPassword <password>

Google Chrome sign-in issues..

For a while I've had a problem signing into Chrome.  I ignored it for the longest until I needed my tabs and bookmarks sync'd so I went looking.
Long story short this is what resolved my issue.

The symptoms were: entering username/passwd, and the sign-in animation keeps spinning forever.

Resolution: Renamed the following folder; c:\users\username\appdata\local\google\chrome\user data\default

Opening chrome will create a new Default folder, allowing you to sign in so all your addins, and info will sync correctly.


Backing up Putty saved sessions

Found a quick way to backup your saved sessions list in Putty..

Export the following registry key:

HKCU\Software\SimonTatham\PuTTY\Sessions

Or via Powershell:

reg export hkcu\software\simontatham\putty\sessions exported_putty_sessions.reg


Tuesday, April 21, 2015

Remotely determining a mac address

So today I had need of finding the mac address of a license server.. this server is a virtual and currently my vcenter server is down.  So unbeknownst to me Windows has had a nice little built-in command since XP called GetMac.

Read more here: https://technet.microsoft.com/en-us/library/bb490913.aspx

For those who don;t want to read it let me give you the simplest syntax for it..


getmac /s <hostname> /u domain\user /p <password>

That's it.  Short, simple and quick.. does exactly what you want it to.  Also there's no subnet limitations like with arp -a.


Enjoy.

Tuesday, April 7, 2015

Office 365: Managing On-premise Distribution Groups - ALTERNATIVE

So I've ran into an issue where people can no longer manage the DL's they are the manager of using Outlook after migrating to O365.  Stupid me for not thinking of this sooner.

I wrote that Powershell script yesterday and today I found something even easier.


 %systemroot%\system32\rundll32.exe dsquery.dll,OpenQueryWindow



Create a shortcut with this as the location and it opens up the ADUC (or ADUG) 's find window.  Allowing the user to search for Groups or Users to modify.  If the user in question is the 'ManagedBy' for a Group then they can edit the membership.

Works like a champ and since it's a gui versus a command line window it's more user friendly.

Monday, April 6, 2015

Powershell: Modifying ADGroup membership

Here's a script I made today that is destined for users who manage certain AD distribution groups for their own departments and the like.





function list_groups
    {
    Get-ADGroup -Filter "managedby -eq '$($user.DistinguishedName)'" |fl samaccountname
    }
function add_member
    {
    $newuser = read-host = "Enter username to add"
    $group = read-host = "Enter the group name you wish to modify as they are named above"
   add-adgroupmember -identity $group -members $newuser
   get-adgroupmember -identity $group |fl name
    }
function remove_member
    {
    $olduser = read-host = "Enter the username you wish to remove"
    $group1 = read-host = "Enter the group name as they are named above"
   remove-adgroupmember -identity $group1 -members $olduser -confirm:$false
   get-adgroupmember -identity $group1 |fl name
    }

$username = Read-host "Enter your username"
$user = Get-ADUser $username

[int]$xMenuChoiceA = 0
do {

Write-host "1. List groups I manage"  -fore Cyan
Write-host "2. Add members to a group" -fore Cyan
Write-host "3. Delete members from a group" -fore Cyan
Write-host "4. Quit and exit" -fore Cyan

$xMenuChoiceA = read-host "Please enter an option 1 to 4"

Switch( $xMenuChoiceA ){
  1
    {
    list_groups
    }
  2
    {
    add_member
    }
 
  3
    {
    remove_member
    }
default
    {
    write-host "Valid responses are 1,2,3,4"
    }
    }
}while  ( $xMenuChoiceA -le 3 )

Connecting to Powershell in Office 365

Here's a little script I've got for connecting to a Powershell session in MSOnline or Office365.




Import-Module MSOnline
# Imports the O365 Commandlets

$CloudCredential=Get-Credential -Credential "username"
# Saves your User name and password

$CloudSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://ps.outlook.com/powershell/" -Credential $CloudCredential -Authentication Basic -AllowRedirection -WarningAction SilentlyContinue

Import-PSSession $CloudSession -Prefix 365
# Sets the O365 Commands to start with 365

Connect-MsolService -Credential $CloudCredential
# Connects to O365 services