Quantcast
Channel: Symantec Connect - Endpoint Management - Articles
Viewing all articles
Browse latest Browse all 861

SMP - Map AD Status from AD Import

$
0
0

In this Article I'm going to show you how to extend the User Resource to include extra properties you can retrieve from the AD Import to gain extra information about your user base. We are going to map the AD Status value (aka UserAccountControl)

First lets create a Data Classes.png Data Class to store this information.

Reports Folder.png Settings | Folder.png Notification Server | Folder.png Resource and Data Class Settings | Folder.png Data Classes

Right-Click | New | Editable Data Class

Call it AD User Details 

Add some Fields

  • ADStatus (Static List)
  • UserAccountControl (String/Integer)
  • LastUpdated (Date)

For the Static List add the following values

  • Active
  • Disabled
  • Deleted

If we take a look at an AD User to see what value this is:

AD - Account (Disabled).png AD - Attribute Editor.png

userAccountControl.png

What does 512 equate to?

http://www.netvision.com/ad_useraccountcontrol.php

ValueDescription
512Enabled Account
514Disabled Account
544Enabled, Password Not Required
546Disabled, Password Not Required
66048Enabled, Password Doesn't Expire
66050Disabled, Password Doesn't Expire
66080Enabled, Password Doesn't Expire & Not Required
66082Disabled, Password Doesn't Expire & Not Required
262656Enabled, Smartcard Required
262658Disabled, Smartcard Required
262688Enabled, Smartcard Required, Password Not Required
262690Disabled, Smartcard Required, Password Not Required
328192Enabled, Smartcard Required, Password Doesn't Expire
328194Disabled, Smartcard Required, Password Doesn't Expire
328224Enabled, Smartcard Required, Password Doesn't Expire & Not Required
328226Disabled, Smartcard Required, Password Doesn't Expire & Not Required

Let's map this value into the new Data Class with the AD Import.

Reports Folder.png Settings | Folder.png Notification Server | Microsoft Active Directory Import.png Microsoft Active Directory Import

Microsoft Active Directory Import - Config.png

Under "User" click on "specified column mappings"

Select the newly created Data Class

AD Import - Coumn Mappings for User.png

Then click on UserAccountControl "(null)" to select a Field

AD Import - Directory entry attribute.png

OK | OK

Run the Import Rule Run Import Rule.png

Now let's create a CMDB Rule.png CMDB Rule to map this number to some text.

Reports Folder.png Settings | Folder.png Notification Server | Folder.png Connector | Folder.png CMDB Rules

CMDB Rule - Set AD Status.png

Resource TypeUser
Target usingSql Query
SQL query<below>
SELECT 
    rru.[Guid],
    rru.Name,
    iaud.UserAccountControl,
    GetDate() AS CurrentDateTime
FROM 
    [RM_ResourceUser] rru
INNER JOIN 
    Inv_AD_User_Details iaud 
    ON iaud._ResourceGuid = rru.Guid

Choose the data class of the one you've just created:

I'm getting the current date from SQL.

LastUpdatedCurrentDateTime

Anybody know how to get the current DateTime in an Expression?

I've tried the following

  • Now()
  • Today()
  • DateTime.Today

With and without equals...

In the 'AD Status' column choose "<Expression>" from the dropdown

Articles

Now we can use a bunch of nested IIFs, it's not eloquent but it works.

IIF([AD User Details.UserAccountControl]='512','Active',
 IIF([AD User Details.UserAccountControl]='514','Disabled',
  IIF([AD User Details.UserAccountControl]='544','Active',
   IIF([AD User Details.UserAccountControl]='546','Disabled',
    IIF([AD User Details.UserAccountControl]='66048','Active',
     IIF([AD User Details.UserAccountControl]='66050','Disabled',
      IIF([AD User Details.UserAccountControl]='66080','Active',
       IIF([AD User Details.UserAccountControl]='66082','Disabled',
        IIF([AD User Details.UserAccountControl]='262656','Active',
         IIF([AD User Details.UserAccountControl]='262658','Disabled',
          IIF([AD User Details.UserAccountControl]='262688','Active',
           IIF([AD User Details.UserAccountControl]='262690','Disabled',
            IIF([AD User Details.UserAccountControl]='328192','Active',
             IIF([AD User Details.UserAccountControl]='328194','Disabled',
              IIF([AD User Details.UserAccountControl]='328224','Active',
               IIF([AD User Details.UserAccountControl]='328226','Disabled','Deleted'
                ))))))))))))))))

I tried a CASE statement but it couldn't get it to verify.

Set a Schedule - a Shared one makes sense, match it to the AD Import.

Protirus.png


Viewing all articles
Browse latest Browse all 861

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>