Need Help Creating Smart Group - Assigned to User & last user differences

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-15-2014 09:18 AM
I am trying to create a smart group that looks at the username of who the computer is assigned to, jsmith1 and then looks to see if last user is the same. I want a smart group of computers where they are not the same. I am sure you can see why this is useful, would help find machines assigned incorrectly.
Any one have any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-15-2014 09:40 AM
I think this would be best suited in an extension object by scripting this out and holding a true/false statement as the result; then basing your smart group on said result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-15-2014 11:58 AM
How are you determining who the computer is assigned to? To find the most recent user I use the following:
#Find most recent user
lastuser=$(ls -t /Users | grep -v "admin" | grep -v "Admin" | grep -v "test" | grep -v "Shared" | grep -v ".localized" | grep -v "Guest" | head -1)
As Geoffrey has mentioned, base a smart group on a comparison of that variable to whomever the computer should be assigned to.
