Search This Blog

Monday, June 17, 2013

How to fix WinMgmt

So I was working on a KB article for our support staff and wrote up the
following....


Upon further review, due to the possibility of affecting the wrong systems,
we decided to leave the at-workstation instructions only.

CMD: DOS command prompt
 PS: PowerShell


*** Desk-side support, a PC Administrator or a client with elevated rights  ***
*** can perform the following remotely...                                   ***


1. With elevated rights open a CMD prompt or PowerShell on your, the
   technician's, computer.


2. Stop winmgmt.

 CMD: sc \\clientPC stop winmgmt
  PS: Stop-Service -InputObject $(Get-Service -Computer "clientPC" -Name "winmgmt")


3. Rename the folder.

 CMD: net use z: \\clientPC\c$
      ren z:\windows\system32\wbem\repository repository_bad
      net use z: -d
  PS: rename-item
\\clientPC\c$\windows\system32\wbem\repository repository_bad

4. Restart the PC.

 CMD: shutdown /m:\\clientPC /r /t:0
  PS: restart-computer -ComputerName "clientPC" -force


*** Desk-side support, a PC Administrator or a client with elevated rights  ***
*** can perform the following at the client's workstation...                ***


1. With elevated rights open a CMD prompt.

2. Type: net stop winmgmt

   Type "Y" when prompted to stop dependent services.

3. Type: ren %windir%\System32\Wbem\Repository Repository_bad

4. Restart the PC.

5. Try your application again.

Thursday, May 17, 2012

How to create a Notes ID from Scratch

To do this you need access to the Notes Administrator Client software and your organizational Cert files.

------------------------

If a client starts the Lotus Notes software with out an ID created for them the client software will create self certified ID for them, without a password that expires in 2 years.

To make one, here is what I did...

Setup - The easy way


I started with a multi-user install of Notes 8.5 and delete the Lotus dir in %USERPROFILE%\Local Settings\Application Data.

Setup - The slightly harder way

Or, if using the single client install of Notes 8.5, Delete the following from the %ProgramFiles%\IBM\Lotus\Notes\Data directory...
  • User.id
  • Desktop8.ndk
  • Names.nsf
  • Bookmark.nsf
  • Notes.ini
Work
 
Start Notes

Fill in the Client Configuration dialog
  • User Name: Use a fictitious name. I used 'A User'.
  • Domino server: Leave blank
  • I want to connect to a Domino server: unchecked
  • Click Finish
This creates a default set of Notes files in the data dir. (Multi-client: %USERPROFILE%\Local Settings\Application Data\Lotus\Notes\Data. Single client %ProgramFiles%\IBM\Lotus\Notes\Data)
  • User.id (A User/A User)
  • a blank Desktop8.ndk
  • a blank Names.nsf
  • a blank Bookmark.nsf
  • a minimal Notes.ini
All of which can be used to baseline a client in many broken states. I keep an off-line copy of these files to fix fix this and other client problems.

If you don't open the bookmark file, the profile doc will not be created. If you do open it with the A User id, then the profile doc will list A User as the owner. This manifest itself when the client opens the address book and sees 'A User - Contacts' as the title of the address book tab in the Notes client and at the top of the address book navigator.

You have finished creating a scratch ID file!  (read on though to finish making a usable ID)
The User.id file that is created is useful for creating  a client id file after the Person Registration process. The Person Registration process add a Person doc to the public address book, creates a mail file (typically), and creates an ID file. Typically the ID file has a minimum password configuration and as a result organizations set a default password. When the creator fat fingers the password the initial ID can be useless. At this point the scratch ID has a place.

Take a copy of the scratch ID and rename it to match the Common Name of the client as listed in their person doc in the public address book.
  1. Start the Notes Administrator Client...
  2. Select Server: local
  3. Go to Configuration Tab > Tools > ID Properties... > Your Identity > Your Names >  Names Changes...
  4. In the notes Name Changes click on Advanced Options...
  5. Click the Obsolescent Name Change... button.
  6. In the Change User Name dialog type in the new name to match the Common Name of the client as listed in their person doc in the public address book. For example 'Lesley Phillips'.
  7. Click OK.
  8. Click OK.
  9. Click Close. The name should now only be 'Lesley Phillips/', changed from 'A User/A User'.
  10. Click Close.
Now re-certify the ID to match the certifier listed in the client's person doc in the public address book.
  1. Start the Notes Administrator Client...
  2. Select Server: local
  3. Go to Configuration Tab > Tools > Certify...
  4. Change the server to your certifier server
  5. Change the certifier ID to the needed certifier (I'm using MyCompany.id which is the cretifier for O=MyCompany)
  6. If you cretifier is password protected, you will need to type it in here and click OK.
  7. In the Choose ID File to Certify pick user.id and click Open.
  8. In Error Accessing Directory Entry dialog, this is ok., click Yes
  9. In the Certify ID dialog, change the options to fit your organization, and click the Certify button.
  10. In the Domino Administrator dialog, click No to finish, or Yes to do another one.

You're done!

Wednesday, May 2, 2012

New Lotus Notes Offers More

Honda wrote the following article, on some of the work I help support, with with a picture of me at my desk. What isn't in the article is that the two monitor workstation is the domain monitor. It is primarly a dashboard of the Domino and Proofpoint servers in our care, and backup admin for thoes occational naughty admins out there. The desktop behind my head is a VM Server where I test OS, Server and Client builds and primary remote controll access point into the network. And finally, behind me (not pictured), is my trusty laptop, which I'm lucky if it last 9 months without a reload due to OS, patches, client reconfigurations, and the occotional bad programming. (We'll just delete that last bit-o-code!)
Permission to reproduce from Honda.

Wednesday, December 28, 2011

R8.5 Upgrade Project Technical Puzzle

So I'm working on an R6.5 to R8.5 Lotus Notes project the servers are done, for the most part. But now we are having trouble getting final buy-in for upgrading the clients. I have 20,000 of them to do when we get around to doing them, so the pilot has to be OK'ed by the group. I Currently, have 400 pilot clients running some version of R8.5. Some are using the 8.5 Mail template and some are not. And my Project Manager wants to know the following:


How many named PCs in the collection of Pilot are running the latest version of the package?
Who is running Notes R8.5 on that PC, so that we can convert their mailbox to R8?

So, here is what I did...

I made a list of PCs listed in the pilot collection (from SCCM) and put it in a file called workstations.txt

us000001
us000001
mx000001
mx000002
cn000001
cn000002

And, wrote the following code...
===============================================================================
'txtFile = "workstations.txt"
txtFile = "workstationsTest.txt"
const HKEY_LOCAL_MACHINE = &H80000002


'   Lotus Notes 6.5.1 Single Client  {1AAE3976-3167-4BDF-B785-00E19C6671A3}
'   Lotus Notes 6.5.4 Single Client  {6B2764B1-F062-4481-94FD-58B1C211C448}
'   Lotus Notes 8.5.1 Single Client  {6ACD1549-274A-491B-A233-2B8B689DD0D3}
'   Lotus Notes 8.5.1 Multi Client   {836670E9-61EB-4D47-9EF8-CFE936C3FE32}
'   Lotus Notes 8.5.2 Single Client  {E11DFB27-BAF4-46D6-AD76-D5519C0E6786}
'   Lotus Notes 8.5.2 Multi Client   {07C69B3A-62B3-41BF-82EE-B3A87BD6EA0C}
'   Lotus Notes 8.5.3 Single Client  {95246D82-99D2-4229-841E-6867C3251087}


 dim reg(7)
 reg(1)="{07C69B3A-62B3-41BF-82EE-B3A87BD6EA0C}" '   Lotus Notes 8.5.2 Multi Client
 reg(2)="{836670E9-61EB-4D47-9EF8-CFE936C3FE32}" '   Lotus Notes 8.5.1 Multi Client
 reg(3)="{6ACD1549-274A-491B-A233-2B8B689DD0D3}" '   Lotus Notes 8.5.1 Single Client
 reg(4)="{6B2764B1-F062-4481-94FD-58B1C211C448}" '   Lotus Notes 6.5.4 Single Client
 reg(5)="{1AAE3976-3167-4BDF-B785-00E19C6671A3}" '   Lotus Notes 6.5.1 Single Client
 reg(6)="{E11DFB27-BAF4-46D6-AD76-D5519C0E6786}" '   Lotus Notes 8.5.2 Single Client
 reg(7)="{95246D82-99D2-4229-841E-6867C3251087}" '   Lotus Notes 8.5.3 Single Client
 
 
dim txtNotesVersion, txtLastUser, txtPersonName, txtMailServer, txtMailFile
dim txtUserName, count
 
on error resume next 'many PCs will not respond

Dim session, db, view, doc

Set session = CreateObject("Lotus.NotesSession")
Call session.Initialize("xxxxxxxxxxxx")
'wscript.echo "Username: " & session.CommonUserName & "..."
set db = session.getDatabase("HRSM0001/SRV/NA/MyCompanyHub", "names.nsf")
set view =db.getView("lookup\shortname")


Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(txtFile, 1)
Do Until objFile.AtEndOfStream
   count = count + 1
   strComputer = objFile.ReadLine
   txtNotesVersion = ReadRegistry(strComputer)
   if len(txtNotesVersion) > 0 then
      txtLastUser = LastUser(strComputer)
      set doc = view.getDocumentByKey(txtLastUser)
      txtPersonName = doc.getItemValue("FullName")
      txtMailServer = doc.getItemValue("MailServer")
      txtMailFile  = doc.getItemValue("MailFile")
   end if
   wscript.echo cstr(count) & ":" & strComputer & ":" & txtNotesVersion & ":" & txtLastUser & ":" & Abbreviate(txtPersonName(0)) & ":" & Abbreviate(txtMailServer(0)) & ":" & txtMailFile(0)
'   wscript.echo cstr(count) & vbTab & strComputer & vbTab & txtNotesVersion & vbTab & txtLastUser & vbTab & Abbreviate(txtPersonName(0)) & vbTab & Abbreviate(txtMailServer(0)) & vbTab & txtMailFile(0)
Loop
objFile.Close
WScript.Quit

 
Function ReadRegistry (strComputer)

   Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
   strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
   strValueName = "DisplayName"
   for i = 1 to 6
      oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath+reg(i),strValueName,strValue
      if len(strValue)>0 then exit for
   next
   ReadRegistry = strValue
end function

function LastUser (strComputer)
   Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
   
   strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon"
   strValueName = "DefaultUserName"
   
   objRegistry.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
   
   LastUser = strValue

end function

function Abbreviate (txtIn)

   txtIn = replace (txtIn, "CN=", "")
   txtIn = replace (txtIn, "OU=", "")
   txtIn = replace (txtIn, "O=", "")
   
   Abbreviate = txtIn
   
end function

===============================================================================

* You may notice about line 43 (wscript.echo cstr(.... ), uses colons as the delimiter. The next line uses tabs, which I used for importing the data into a spreadsheet.

Which produces the following output...
1:us000001:Lotus Notes 6.5.4:MS000001:Mary Smith/RSM/NA/MyCompany:SRSMM001/SRV/NA/MyCompany:mail\MS000001
2:us000002:Lotus Notes 6.5.4:JJ000002:James Johnson/AMA/NA/MyCompany:SMMOM023/SRV/NA/MyCompany:mail\JJ000002
3:mx000001::MH000001:María Hernández/OAX/NA/MyCompany:SMOXA001/SRV/NA/MyCompany:mail\MH000001
4:mx000002:Lotus Notes 8.5.1:SC000001:Santiago García/OAX/NA/MyCompany:SMOXA001/SRV/NA/MyCompany:mail\SC000001
5:cn000001:Lotus Notes 8.5.2:EL000001:Emma Li/PEI/NA/MyCompany:SMPEI001/SRV/NA/MyCompany:mail\ELi
6:cn000002:Lotus Notes 8.5.1:JL000001:Jacob Lam/PEI/NA/MyCompany:SMPEI001/SRV/NA/MyCompany:mail\JL000001

* Line 3: Turns out Maria's PC does not have Notes installed on it.

Which I pipped to a .txt file for later manipulation and merging with other data sources.


Thursday, August 25, 2011

Lotus Notes Revision Numbers

In my current R8.5 Notes client upgrade the pilot clients have a veriety of builds. To help keep track of it all, Here is a partial list of Lotus Notes revision numbers.

20090615.0130 (Release 8.5.1)
20090920.1010 (Release 8.5.1)
20090929.1223 (Release 8.5.1)
20091002.1006 (Release 8.5.1 FP1)
20101103.0200-FP1 (Release 8.5.2FP1)
20100524.0930-FP3 (Release 8.5.2FP3)
20100726.1445_FP4 (Release 8.5.2FP4)
20100811.1131 (Release 8.5.2)
20101103.0200-FP1 (Release 8.5.2FP1)
20110711.1400-FP3 (Release 8.5.2FP3)

Saturday, June 25, 2011

a LARP Story

At the Origins Game Fair 2011 in Columbus, Ohio The Origins Dungeon 2011 was being hosted by NERO Chicago and run by Steve Cecchin.

So this was my first attempt at a Live Action Role Playing game. On Saturday, to get a feel for it, I partially watched an earlier group start their run and, after some strong goading by my spouse Barb, thought "What the heck? I'll give it a go!" I signed up for the next round at 2 pm.

This was a larger group than I watched earlier. While the earlier group had 6 players, This group had 13. After some quick organizing, we ended up with 7 fighters, 3 Clerics (healers), and 3 Wizard. I was a Wizard.

The basic plot to this story was that the evil necromancer Xerxis has kidnapped a princess and we were to rescue her. The GM (Game Master. He is the referee) followed to "assist" if we all got in to "to much trouble".

So, with lots of undead encounters we made it through the entrance of the mine/cave to the rune-riddled-triggered-secret-door-boss-encounter entrance. One of the riddles referred to a wise person standing at one of the rune stones. Apparently, my gray hair made me the wisest person there. Which seemed to settle the GM ruling and the door was eventually opened. After which, we had some fierce fighting to the Boss chamber.

In the Boss chamber was Xerxis, his main minion (quite a fierce looking skeleton with a very big sword), and all the other minions, re-spawned for our slaying pleasure. Oh, and the Princess was, looking quite kidnapped, tied up in a corner. Xerxis froze our 2 lead fighters at the entrance leaving the rest of us trapped behind them in the hall. The ruling was that the players were frozen while within sight of Xerxis. Xerxis then started to monologue. He started by pleading for the case against our invading his home and destroying all that he had built there. Then after getting the leading players to stop and chat, he started to negotiate a ransom from the players. Some gold coin, and some of their weapons.

Suddenly, a stone was thrown hitting Xerxis. Someone shouted "One point normal!". Everyone stopped, stunned, and Xerxis shouted out "Who did that?!?". He sounded very angry. A wizard's hand shot up from the back of the players and, after a path was quickly cleared, I answered "I did!" One of the players commented "I thought you were wise!". It was at this point, Barb, who had been following along, watching and taking pictures started to laugh her behind off. Continuing... "I was wondering if you could show me the way to the rest room? I didn't have a chance to stop before we came in, and I really have to go." Still shock and stunned silence. the GM leaned over and and asked "Do you really have to go?". Out of the corner of my mouth I said "It's called 'guile' man!" To which, he leaned away, rolled his eyes and said "I don't think he would have gone for it."

Finally, the fighters freeze spell wore away, and we were in the final battle. After overcoming the Xerxis' main minion, the battled went back in to the tunnels. Most of the fighters went off to chase Xerxis leaving a few of us left in the Boss room. Oh, and the princess was there, unconscious and tied up in the corner. Recognizing this I found a cleric and we healed her, untied her, and got her a weapon. She apparently likes her sword, but grudgingly took an axe that we had.

As the Princess started down the tunnels toward the entrance, the cleric and I were attacked from the rear by a re-spawning skeleton. The cleric cast a disarm spell. Upon the skeleton dropping the sword, the Cleric grabbed it, and I charged. The Skeleton stood there dejected and said "This is going to suck...", as I reduced him to a pile of bones with my dagger. "One point normal!" (a few times), and the cleric got in a blow too.

In one attack from the rear I was incapacitated. A skeleton attacked me twice "Ten points normal!" each. I though I was dead. One of the players came up to heal me. I told him I though I was dead. I told him, while holding up a little white card, that the GM had previously given me a ring of resurrection to be used on some player, "not yourself." The Princess, standing there, made a motion with her hand, stright fingers to thumb in a sign to shut-up, and told me "You're dead!" I think she was just testy from the whole kidnapping, tied-up, unconscious thing? So I lay there. The GM Ruled that I don't know how to count health points and armor vs. damage and ruled that I was alive and that the healing worked. Hooray, I survived!

But somewhere in the mix Xerxis tricked us and was able to casually stroll out and excaped!

Naughty evil necromancer!



http://www.originsgamefair.com/
http://www.nerochicago.com