title: Powershell and Lotus Notes - How to extract user names with employees numbers?
body: <p>I have specific problem. I need to extract domain names from active directory and combine them with employees numbers which are in Lotus Notes. I get the domain names with Get-QADUser (snapin from quest.com), that was no problem, but how to get the employees numbers and combine them? Thank you</p>
  
  <p>Edit(18.5. 11:56): Now I'm using this script (posted by Christian) and I figured out how to get the name of LN database - right-click on DB in Lotus notes workspace, then application/properties.</p>
  
  <pre><code># Create LN Object
  $DomSession = New-Object -ComObject Lotus.NotesSession
  
  # Initialize LN Object
  # You'll be asking for LN password to your id
  $DomSession.Initialize()
  
  # Connect to Server, select db and display the name
  $DomDatabase = $DomSession.GetDatabase("LN007","IT\HW.nsf")
  Write-Host "Database open : " $DomDatabase.Title
  
  # Open specific View (By Serial Number)
  $DomView = $DomDatabase.GetView('Serial Number')
  Write-Host "View read : " $DomView.Name
  
  # Show number of documents
  $DomNumOfDocs = $DomView.AllEntries.Count
  Write-Host "Num of Docs : " $DomNumOfDocs
  
  # Get First Document in the View
  $DomDoc = $DomView.GetFirstDocument()
  </code></pre>