Search This Blog

Saturday, August 30, 2014

Microsoft MTA Windows Server Administration 98-365

I just finished CBT Nuggets Microsoft MTA Windows Server Administration 98-365 series. It had a few things I didn't know yet. It was neat to see the new tools I had been missing. I'm already torturing the few real experts I know.

Wednesday, August 20, 2014

Notes Redirect File

The Notes Redirect File or .nrf is a text file that can be created automatically when you use the admin client to delete a database and you want to leave a clue, for the accessing clients, as to where they can go to continue to access a replica of the db.

 We use this when we remove a replica of a database so that client can continue to access the file on the another server. The format looks like this:

[NotesRedirectFile] 
Type=Move 
RepID=87654321:12345678 
Title=lesleysRedirTest 
Ref=CN=APP001/OU=SRV/O=MyCompany!!isg\lesleysRedirTest.nsf 

The name of this file is lesleysRedirTest.nrf (matching the name of the db, lesleysRedirTest.nsf) and, it goes in the directory of the server that the db replica is being deleted from.

In this case we deleted the db from server APP002/SRV/MyCompany and clients clicking the bookmarks or workspace icons going to APP002 will automatically have their links to APP002 deleted and replaced with links to the db on APP001.

 If you need to get a hold of a replica id of the db, in case you forgot to create the redir on delete, you can get one from the remaining dbs and get a db link. When you paste the db link in to a text editor you will get the following, with the replica id in it...

lesleysRedirTest
<NDL>
<REPLICA 87654321:12345678>
<HINT<CN=APP001/OU=SRV/O=MyCompany</HINT>
<REM>lesleysRedirTest</REM>
</NDL>

Tuesday, June 18, 2013

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.