Saturday, September 20, 2008

KMS woes

What's really frustrating is that there is no tool or command to see which hosts are listed in the "count" displayed when you run slmgr on your KMS server.

I stood up some server 08 machines the other day (yes some were vms, yes I have read the piece about each physical machine being counted) and can't seem to get to the 5th host in the "count"

I stood up vms on 3 different physical servers, then 2 other physical hosts and still didn't get to 5. So then I load up a server 08 instance in vmware workstation on my desktop machine that has never activated 08 of course, and I still have 4 listed in my count. (yes I've also gone around and run the -rearm command on hosts, that doesn't do anything either)

Sure it shows in the event log that it is talking to the KMS server just fine but it's not incrementing my count as it should!

So currently I've got 6 different physical machines running 08 and KMS tells me I only have 4... Way to make my life more difficult MS. Why require 5 physical machines when virtualization is so prevelant these days, especially with new servers being deployed? Especially when which shops will be using KMS? Volume clients which are more likely to be using virtualization anyways!

If KMS could accurately seem to determine physical hosts then I'd be more ok with it.

If KMS could simply tell me which of my hosts out there are counted in the 'count' then I'd be more ok with it.

I really don't care about the lack of a gui, I care about the lack of functionality that has now cost me 3 hours of my time which provides NO benefit to my job.

Thanks Microsoft.

PS I'm going to really enjoy calling you to resolve this problem that could have been easily solved by simply making this tool better. I'll post back here what the problem was.

Friday, April 25, 2008

Delete Cookies Script



'Script is in testing as of 4.21.08

On Error Resume Next

' Parse time/date and then subtract a year from it

Const CONVERT_TO_LOCAL_TIME = True

Set dtmStart = CreateObject("WbemScripting.SWbemDateTime")
dtmStart.SetVarDate Now, CONVERT_TO_LOCAL_TIME
dtmRegular = dtmStart.GetVarDate(CONVERT_TO_LOCAL_TIME)
dtmRegular = DateAdd("yyyy", -1, dtmRegular)

' not needed due to not needing to convert back the time/date format
' dtmStart.SetVarDate dtmRegular, CONVERT_TO_LOCAL_TIME

'Wscript.Echo dtmRegular

' set constants for cookies folder and temp int folders

Const COOKIES = &H21&
Const TEMPINT = &H20&

Set objShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")

'set path to cookies

Set objFolder = objShell.Namespace(COOKIES)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path

'delete cookies in cookies folder

Set folder = objFSO.GetFolder(strPath)
Set files = folder.Files
for each objFile in files
if objFile.DateLastModified < dtmRegular and objFile.Type = "Text Document" then
objFile.Delete
end if
next

'set folder to temporary internet files

Set objFolder = objShell.Namespace(TEMPINT)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path

'delete cookies in temporary internet files

Set folder = objFSO.GetFolder(strPath)
Set files = folder.Files
for each objFile in files
if objFile.DateLastModified < dtmRegular and objFile.Type = "Text Document" then
objFile.Delete
end if
next



Note: this can also be accomplished a little simpler through the forfiles command.