Tuesday, June 26, 2012

Hyper-V host - slow internet browsing

After setting up Hyper-V on Windows 8 I noticed that when my Domain Controller VM was turned on(hosting AD, DHCP and DNS) my host PC would take a long time to surf the internet.

I did a speed test and, after making the initial connection, saw that my download/upload speeds were normal I realized that it must be because I was hitting the DNS of my "Internal" DNS host on the VM.

Quick fix -
Open your network connections and hit the "alt" button.  Open Advanced - Advanced settings like so:



Then move your External Virtual Switch adapter connection to the top of the priority list like so:

This should restore your host Internet surfing abilities to normal.

Friday, June 22, 2012

Bitlocker recovery key didn't get uploaded to Active Directory

For some reason a laptop did not upload it's encryption key to Active Directory after bitlocker was enabled. I can only assume that it had lost network connectivity somehow.

So I needed to find a way to get the key into Active Directory manually after bitlocker was enabled and most of my google searches were of no help.

This is what I have come up with -
Start with a cmd prompt (ran as an administrator)
Enter the following command: manage-bde -protectors -adbackup C: -id {recoveryGUID}


You might be asking yourself what is the recoveryGUID???
The volume GUID can be found by executing the following:

  1. Right click the volume (ex. C: drive) that is bitlocker'ed and choose Manage BitLocker
  2. Choose save or print recovery key again
  3. Choose save to file
  4. We are looking for the "Full recovery key identification".  That is the GUID of the volume that you selected and is also the "id" used with the manage-bde command above.  Make sure you include the brackets with the ID
That should be it, double check in AD to make sure that the information for the recovery key has been populated in the computer object.


Tuesday, June 19, 2012

Accidentally deleted "All Systems" Collection

*somehow* the All Systems collection had gotten deleted.  I didn't really think anything of it until our HelpDesk system was unable to use it's Asset Inventory function because it was polling the SMS00001 collection.

With some help from Chris Nackers blog I found this vb script which restored the collection with the appropriate collection ID -


'###Begin Code

strSMSServer = "ENTER SERVERNAME HERE" 
strParentCollID = "COLLROOT" 
'This example creates the collection in the collection root. 
'Replace COLLROOT with the CollectionID of an existing collection to make the new collection a child.

strCollectionName = "All Systems" 
strCollectionComment = "This is the All Systems Collection." 
Set objLoc = CreateObject("WbemScripting.SWbemLocator") 
Set objSMS = objloc.ConnectServer(strSMSServer, "root\sms") 
Set Results = objSMS.ExecQuery ("SELECT * From SMS_ProviderLocation WHERE ProviderForLocalSite = true")

For each Loc in Results 
If Loc.ProviderForLocalSite = True Then 
  Set objSMS = objLoc.ConnectServer(Loc.Machine, "root\sms\site_" & Loc.SiteCode) 
End if 
Next

Set newCollection = objSMS.Get("SMS_Collection").SpawnInstance_()

'Create new "All Systems" collection 
newCollection.Name = "All Systems" 
newCollection.OwnedByThisSite = True 
newCollection.Comment = strCollectionComment 
newCollection.CollectionID = "SMS00001" 
path = newCollection.Put_

'Set the Relationship 
Set newCollectionRelation = objSMS.Get("SMS_CollectToSubCollect").SpawnInstance_() 
newCollectionRelation.parentCollectionID = strParentCollID 
newCollectionRelation.subCollectionID = ("SMS00001") 
newCollectionRelation.Put_

'###End Code

Then all I had to do was add my customized query, that removes discovered apple devices, into the collection and do an update/refresh and presto (You could remove the "where" part of the statement to get it back to original) -

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client
from SMS_R_System
where SMS_R_System.Name not like "%AD"
and  SMS_R_System.Name not like "%AL"

Saturday, May 26, 2012

Windows to Go for Windows 8 or Windows 8 Server (boot from USB)

I wanted to play around with Hyper-V on my laptop but didn't want to wipe Windows 7 to do it and I wasn't about to dual-boot.

Enter a cool new feature from the windows 8 family - "Windows to Go" .  Windows to Go allows you to install the Windows 8 family onto, that's right not from, a USB stick.

This process is the same for either Windows 8 (client) or Windows 8 Server

Tools used:

  • Most others say that you have to download Windows AIK (1.8gb) just to make use of imagex.exe but I have spoken about gimagex.exe before.  It's just a GUI wrapper for imagex and works well if you don't really like to memorize a bunch of command lines to image systems and it's FREE!
  • Either Windows 8 Consumer Edition ISO or Windows 8 Beta
  • A tool like WinRar to extract the files from the ISO
  • diskpart.exe


Hardware Required:

  • At least a 16Gb usb thumb drive.  You are going to want to purchase a usb 3.0 drive if you have the slots available as this is booting windows from the USB key.

Steps:

  1. Open command prompt and enter the following commands
    1. List Disk - This will show you a list of the physical disks that you have plugged into your computer.  Make note of the number that is your USB key
    2. Sel Disk 1 - where 1 is your USB stick
    3. Clean - wipes the drive out
    4. Create Partition Primary
    5. format fs=ntfs quick label=Win2Go
    6. active
    7. assign
    8. exit
  2. Extract the Windows 8 ISO to c:\extracted\win8 (or wherever you are comfortable with)
  3. Open gimagex.exe
  4. Select the Apply tab at the top
  5. Select the install.wim file from the extracted ISO - ie. c:\extracted\win8\sources\install.wim as the Source
  6. Select the drive letter of your freshly formatted USB key as the Destination
  7. Click Apply and wait :) 

  8. Once gimagex Apply reaches 100% open a command prompt and enter the following command:
    1. bcdboot f:\windows /s f:  - where f: is your usb key
That's it, your done!  Boot your computer off of your usb key and let setup complete.

Friday, May 11, 2012

Setting Local Admin account to not expire

So I was using this command - 
net user username password /expires:never /passwordchg:no /comment:"Desktop Support" /add
- to create the local administrator account during OSD but the password was still set to expire.

I guess I misunderstood the /expires:never switch.  This sets the account to never expire not the password.

So in addition to the aforementioned net user command I added a wmic command that sets the password to never expire:

wmic path Win32_UserAccount WHERE Name="username" set PasswordExpires=False

Wednesday, March 14, 2012

Running SCCM Console as another user

As a personal best practice I log into my main workstation with a user ID that does not have access to anything but my exchange mailbox and my personal network drive.  I had grown tired of shift right clicking to run as another user so I looked up how to always launch a shortcut as a different user.

What you would typically do is put c:\windows\system32\runas.exe /user:domain\user /savecreds before the link to the exe.  Since the SCCM admin console is an mmc snap-in it looks a little different.

This is what I ended up with - C:\Windows\System32\runas.exe /user:domain\user /savecreds "mmc \"C:\Program Files (x86)\Microsoft Configuration Manager Console\AdminUI\bin\adminconsole.msc""

Yes that extra floating \ is necessary.

Friday, March 9, 2012

gimagex - Error: Unable to mount image ???

I was trying to mount a wim image using gimagex and was getting this error - Error: Unable to mount image ???

I did some digging and found the following -



  1. Make sure GImageX is closed. Open Regedit.
  2. Navigate to "HKLM\Software\WIMMount\Mounted Images"
  3. You should see a subkey with a long name like "374cf018-f245-442d-9544-d6a2092607e0". Delete this key. (Don't worry about deleting this key, it should have been removed anyhow)
  4. Close Windows Explorer and reopen it. Delete the folder you used as your mount point (eg. "c:\mount"), then re-create it.
  5. Restart GImageX and the image should open correctly again.

Remote Mailboxes - Hybrid Config - Missing

The Remote Mailbox exists on the On Prem Exchange server and linked to the Office 365 mailbox. Without one of these for each Office 365 mail...