TexasSwede
texasswede@gmail.com
  • About this blog
  • My Website
  • My Resume
  • XML Export Tool
  • Photos

Monthly Archives: December 2015

Free Code – Clean groups in Domino Directory

Posted on December 16, 2015 by Karl-Henry Martinsson Posted in Lotusscript, Programming 8 Comments

The other day I had to clean up the groups in our Domino Directory. Many groups still contained names of terminated users, they had not been cleaned/maintained properly. We also removed some groups over time, but some of them were still listed as members of other groups.

So I wrote a small Lotuscript agent to perform this cleanup. I am posting it below in case someone needs it. As always: no guarantees, use at your own risk, etc.

Update: As some commenters pointed out, there are some issues with the code. First of all, I was using a view my company added to name.nsf. The view PeopleByFirstName has the following selection formula: SELECT Type = “Person” & TerminationDate=””
The field TerminationDate is one we added to the person document. This field is either blank (for current employees) or contains the date they were terminated (and then they are filtered out of most views).

Also as Christian points out, any groups that contains external users would be clenaed out. In the past when I worked at a company that used mail groups with external users, those groups were kept in a separate (secondary) Domino Directory, names_ext.nsf. So this is something to keep in mind if you choose to use this code.

Finally I have updated the code with a few more lines. It will now ignore server groups, and also get a list of all servers and make sure they are included as group members when the groups are processed.

Thanks for pointing out the problems with the code!

 

Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim userNames List As String
Dim groupNames List As String
Dim serverNames List As String
Dim groups List As NotesDocument
Dim tmp As String
Dim tmpname As NotesName
	
Set db = New NotesDatabasesession.CurrentDatabase.Server,"names.nsf")
'*** Get all existing groups and put in a list
Set view = db.getView("Groups")
Set doc = view.GetFirstDocument()
Do Until doc Is Nothing
    Set groups(doc.UniversalID) = doc
    tmp = doc.GetItemValue("ListName")(0)
    groupNames(tmp) = tmp
    Set doc = view.GetNextDocument(doc)	
Loop

'*** Get all active users and put in a list
Set view = db.getView("PeopleByFirstName")
Set doc = view.GetFirstDocument()
Do Until doc Is Nothing
    tmp = doc.GetItemValue("FullName")(0)
    Set tmpname = New NotesName(tmp)
    userNames(tmpname.Common) = tmpname.Common
    Set doc = view.GetNextDocument(doc)	
Loop

'*** Get all servers and put in a list
Set view = db.getView("Servers")
Set doc = view.GetFirstDocument()
Do Until doc Is Nothing
    tmp = doc.GetItemValue("ServerName")(0)
    Set tmpname = New NotesName(tmp)
    serverNames(tmpsname.Common) = tmpname.Common
    Set doc = view.GetNextDocument(doc) 
Loop	
'*** Loop though list of groups and process each one
ForAll g In groups
    '*** Check that not server group
    If g.GetItemValue("GroupType")(0)<>"4" Then  
        tmp = ""
        '*** Store existing list of group members in a backup field
        Call g.ReplaceItemValue("MembersBackup",g.GetItemValue("Members")) 
        '*** Loop through all members of the group
        ForAll m In g.GetItemValue("Members")
            Set tmpname = New NotesName(m)
            '*** If the name is an existing group or an active user, add to list
            If IsElement(userNames(tmpname.Common)) _
            Or IsElement(groupNames(tmpname.Common)) _
            Or IsElement(serverNames(tmpname.Common))Then
                tmp = tmp + tmpname.Canonical + ";"
            End If
        End ForAll
        '*** Write list back to members field
        Call g.ReplaceItemValue("Members", FullTrim(Split(tmp,";")))
        Call g.Save(True,False)
    End If
End ForAll
MsgBox "Done!"

 

Connect 2016 – People, not technology

Posted on December 15, 2015 by Karl-Henry Martinsson Posted in Community, Connect, IBM/Lotus, Lotusphere Leave a comment

For the 20th time I am heading to the conference previously known as Lotusphere. IBM has renamed it Connect, but to me it still is the same conference. The focus may have changed from Notes and Domino to Connections, Cloud and Mobile, but the people is largely the same: a mix of developers, administrators and managers who all are interested in or using the IBM collaboration products.

As a wise man said: it’s not about technology, it’s about the people. And I am looking forward to the people. I have many good friends in the Yellowsphere community (I don’t have a better name for the IBM Collaboration Software community), people I admire and have learned much from over the years. I hope that speaking at Connect 2016 (a first for me) will help others like I been helped in the past. That is why I enjoy helping people out in the forums and on Stack Overflow, and why I blog and share code: a way to give back to the community.

Lotusphere/Connect is a way to connect with the community. Every year I leave the conference revitalized and energized. I have been hanging out with my peers, sharing a couple of adult beverages, having dinners with some of them and — most of all — getting ideas and inspiration. Working as the only Notes developer at a company gets lonely, and Lotusphere/Connect is the one of the few time of the year I get to “talk shop” with people that do the same thing as I do. No mater how understanding and technical my wife is, when I start talking about some cool Lotusscript class or the benefits of list over arrays her eyes glace over and she is gone…

As I write this, my workplace is migrating from Notes to Outlook/Exchange for email. A pilot group (including me) was migrated last weekend, and the rest of the users will be migrated this coming weekend. Applications will stay in Notes for a long time, though. They are not going anywhere.

Even if I would have switch to a different platform for development at work, I hope to still be involved in the Yellowsphere community. I am also working on some cool side projects where I use Domino as the data backend but where the browser based front-end is built using modern web technologies like Bootstrap and jQuery. So I hope to be doing things with Notes and Domino for many more years.

So if you haven’t registered for Connect 2016 yet, hurry up. We are getting close. I booked my flight and my room earlier today and for the first time since 1999 I will not be staying at the conference hotel. Instead I found a good rate at Days Inn across the street, about a 5 minutes walk away away and at 25% of the cost. Since I am once again paying out of my own pocket, I could not justify the cost of staying at Hilton where the conference takes place.

If you want to listen to my session “AD-1100 : Break Out of the Box – Integrate Existing Domino Data with Modern Websites” it takes place at 5pm on Tuesday February 2 in the Solution EXPO Theater. It’s a 20 minute long (or should I say short?) Lightning Talk.

I hope to see you in Orlando in January and February!

IBM Connect 2016 coming up!

Posted on December 8, 2015 by Karl-Henry Martinsson Posted in Community, Connect, IBM/Lotus, Javascript, jQuery, Lotusphere, Notes/Domino, Web Development 1 Comment

Connect2015_People1In the end of January it is once again time to head to Orlando for the yearly conference that for many years was known as Lotusphere. For the last few years it have been renamed IBM Connect (as well as ConnectED in 2014), and last year most people (including me) thought that 2015 was the end of this conference.

But perhaps due to the popularity of the 2015 edition, IBM decided to have the conference again this year, but in a new location as the contract with Swan and Dolphin (where the conference had been held since the first one in 1993) had expired.

The fountain at WDW Dolphin

The fountain at WDW Dolphin

The new venue is Hilton Orlando. It is closer to the airport and there are also more restaurants around than at Swan and Dolphin. It is close to SeaWorld as well as to the Universal Studios theme parks. Personally I am excited about the new venue. “Swolphin” (as Swan and Dolphin often was referred to) started to get old and worn down, despite a refresh of the rooms back in 2003-2005 some time. Yes, after this many years (18 in a row for me) Swolphin started feeling like a home away from home. You know where everything is, you know the staff and the shortcuts between hotels and sections within the hotel.

So a new location makes Connect 2016 more exciting, it will feel like a new conference but hopefully with many of my old friends attending. I have already found several interesting sessions using the session tool. Philippe Riand and Jesse Gallagher will for example talk about the Darwino application development platform, which allows you to integrate your Domino applications with IBM Bluemix an IBM Connections. Another must-attend session is called IBM Domino App.Net and talks about how to utilize Bluemix to build XPages applications in the cloud.

In addition we of course have all the sessions we have come to know and love: UserBlast with Mat Newman, Admin Tips Power Hour presented by Chris Miller, Spark Ideas, and of course the Opening General Session (OGS) with a secret guest speaker as the tradition requires.

HP_GringottsAfter the fiasco last year with the Tuesday evening special event the organizers went back to holding the event in one of the local theme parks. For the second time it will be held in the Wizarding World of Harry Potter – Hogsmead, which is part of Universal’s Islands of Adventure. Last time I had a blast, so much that last year I took a couple of vacation days to visit Hogsmead again as well as the then newly opened Diagon Alley extension over in the Universal Studios park next-door. You need a park-to-park admission pass to visit both parks, but that allows you to take the Hogwarts Express between the two parks.

ConnectSessionLetterFor me personally Connect 2016 is a milestone. It will be my 20th Lotusphere/Connect and for the first time I will present a session!

This is not a full one hour session, but a new format called Lightning Talk. Those are shorter 20 minute sessions, and not all of them are listed in the session tool on the conference site yet. I think this is a very interesting concept, and I believe it will be successful. I can see myself attending a number of shorter sessions like this to get a good overview of a particular subject, then go on and learn more later.

My session is called “Think outside the box” and I will show how you can connect to a Domino backend from a traditional web application and retrieve data in JSON format. This data can then be used to populate fields/values on a page or used in jQuery/Bootstrap plugin like calendars and data tables. This is a version of the presentation I did at MWLUG in Atlanta, but shorter and with some new content added.

I hope to see you at Connect 2016 in Orlando, perhaps even at my session. If you haven’t registered yet, it is time to do it now. Stay tuned for more posts here leading up to the conference.

Stack Exchange

profile for Karl-Henry Martinsson on Stack Exchange, a network of free, community-driven Q&A sites

Recent Posts

  • Domino 14 is now available
  • Domino 14 Early Access Program
  • Announced: Engage 2024
  • Integrate Node-RED with Notes and Domino
  • Notes and Domino v12 is here!

Recent Comments

  • Theo Heselmans on Announced: Engage 2024
  • Lotus Script Multi-thread Message Box [SOLVED] – Wanted Solution on ProgressBar class for Lotusscript
  • Viet Nguyen on Keep up with COVID-19 though Domino!
  • Viet Nguyen on Keep up with COVID-19 though Domino!
  • Mark Sullivan on Looking for a HP calculator? Look no further!

My Pages

  • How to write better code in Notes

Archives

  • December 2023 (1)
  • October 2023 (2)
  • September 2023 (1)
  • June 2021 (1)
  • April 2021 (2)
  • March 2021 (1)
  • August 2020 (3)
  • July 2020 (2)
  • April 2020 (2)
  • March 2020 (1)
  • December 2019 (2)
  • September 2019 (1)
  • August 2019 (2)
  • July 2019 (2)
  • June 2019 (3)
  • April 2019 (2)
  • December 2018 (1)
  • November 2018 (1)
  • October 2018 (5)
  • August 2018 (2)
  • July 2018 (3)
  • June 2018 (2)
  • May 2018 (1)
  • April 2018 (2)
  • March 2018 (1)
  • February 2018 (2)
  • January 2018 (4)
  • December 2017 (3)
  • November 2017 (2)
  • October 2017 (2)
  • September 2017 (1)
  • August 2017 (2)
  • July 2017 (6)
  • May 2017 (4)
  • February 2017 (1)
  • January 2017 (2)
  • December 2016 (2)
  • October 2016 (3)
  • September 2016 (4)
  • August 2016 (1)
  • July 2016 (2)
  • June 2016 (2)
  • May 2016 (3)
  • April 2016 (1)
  • March 2016 (4)
  • February 2016 (2)
  • January 2016 (4)
  • December 2015 (3)
  • November 2015 (2)
  • October 2015 (1)
  • September 2015 (2)
  • August 2015 (1)
  • July 2015 (5)
  • June 2015 (2)
  • April 2015 (2)
  • March 2015 (3)
  • February 2015 (2)
  • January 2015 (10)
  • December 2014 (1)
  • November 2014 (3)
  • October 2014 (3)
  • September 2014 (13)
  • August 2014 (6)
  • July 2014 (5)
  • May 2014 (3)
  • March 2014 (2)
  • January 2014 (10)
  • December 2013 (5)
  • November 2013 (2)
  • October 2013 (5)
  • September 2013 (4)
  • August 2013 (7)
  • July 2013 (3)
  • June 2013 (1)
  • May 2013 (4)
  • April 2013 (7)
  • March 2013 (8)
  • February 2013 (9)
  • January 2013 (5)
  • December 2012 (7)
  • November 2012 (13)
  • October 2012 (10)
  • September 2012 (2)
  • August 2012 (1)
  • July 2012 (1)
  • June 2012 (3)
  • May 2012 (11)
  • April 2012 (3)
  • March 2012 (2)
  • February 2012 (5)
  • January 2012 (14)
  • December 2011 (4)
  • November 2011 (7)
  • October 2011 (8)
  • August 2011 (4)
  • July 2011 (1)
  • June 2011 (2)
  • May 2011 (4)
  • April 2011 (4)
  • March 2011 (7)
  • February 2011 (5)
  • January 2011 (17)
  • December 2010 (9)
  • November 2010 (21)
  • October 2010 (4)
  • September 2010 (2)
  • July 2010 (3)
  • June 2010 (2)
  • May 2010 (3)
  • April 2010 (8)
  • March 2010 (3)
  • January 2010 (5)
  • November 2009 (4)
  • October 2009 (7)
  • September 2009 (1)
  • August 2009 (7)
  • July 2009 (1)
  • June 2009 (4)
  • May 2009 (1)
  • April 2009 (1)
  • February 2009 (1)
  • January 2009 (3)
  • December 2008 (1)
  • November 2008 (1)
  • October 2008 (7)
  • September 2008 (7)
  • August 2008 (6)
  • July 2008 (5)
  • June 2008 (2)
  • May 2008 (5)
  • April 2008 (4)
  • March 2008 (11)
  • February 2008 (10)
  • January 2008 (8)

Categories

  • AppDev (10)
  • Blogging (11)
    • WordPress (5)
  • Design (5)
    • Graphics (1)
    • UI/UX (2)
  • Featured (5)
  • Financial (2)
  • Food (5)
    • Baking (3)
    • Cooking (3)
  • Generic (11)
  • History (5)
  • Hobbies (10)
    • LEGO (4)
    • Photography (4)
  • Humor (1)
  • IBM/Lotus (178)
    • #Domino2025 (14)
    • #DominoForever (8)
    • #IBMChampion (46)
    • Administration (7)
    • Cloud (7)
    • CollabSphere (9)
    • Community (49)
    • Connect (33)
    • ConnectED (12)
    • Connections (3)
    • HCL (15)
    • HCL Master (1)
    • IBM Think (1)
    • Lotusphere (46)
    • MWLUG (25)
    • Notes/Domino (99)
      • Domino 11 (7)
    • Sametime (8)
    • Verse (14)
    • Volt (3)
    • Watson (6)
  • Life (8)
  • Microsoft (7)
    • .NET (2)
    • C# (1)
    • Visual Studio (1)
  • Movies (3)
  • Old Blog Post (259)
  • Personal (23)
  • Programming (84)
    • App Modernization (11)
    • Formula (4)
    • Lotusscript (47)
    • NetSuite (4)
      • SuiteScript (3)
    • node.js (4)
    • XPages (4)
  • Reviews (9)
  • Sci-Fi (4)
  • Software (24)
    • Flight Simulator (2)
    • Games (4)
    • Open Source (2)
    • Utilities (6)
  • Technology (37)
    • Aviation (3)
    • Calculators (2)
    • Computers (6)
    • Gadgets (7)
    • Mobile Phones (7)
    • Science (3)
    • Tablets (2)
  • Travel (7)
    • Europe (1)
    • Texas (2)
    • United States (1)
  • Uncategorized (16)
  • Web Development (50)
    • Frameworks (23)
      • Bootstrap (14)
    • HTML/CSS (12)
    • Javascript (32)
      • jQuery (23)

Administration

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tracking

Creeper
MediaCreeper
  • Family Pictures
© TexasSwede 2008-2014