Skip to main content
Question

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


Forum|alt.badge.img+11

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?

2 replies

geoffreykobrien
Forum|alt.badge.img+9

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.


Forum|alt.badge.img+6
  • Contributor
  • 11 replies
  • July 15, 2014

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings