Client Management Suite

 View Only
  • 1.  Create a filter with powershell?

    Posted Feb 20, 2016 12:09 PM

    Hello everyone. I'm new to CMS and trying to figure out how to create a dynamic filter with powershell. I may be going at this the wrong way and any feedback would really be appreciated.

    The company I work for would like to deploy software to departments not based on AD OU but instead a hierarchical listing. I have a manager name and have run a powershell script that will output the names of all employees that fall under my target manager. The script works great however I would like to know if it is possible to create a filter off of the results.

    I understand how to create a filter with a list of names but this list must be dynamic. The list must change when an employee joins or leaves which means the powershell script must run at least once a day and the results must update the filter. I would then use the filter to push software to the correct group.

    Is it possible to create a dynamic filter based off a powershell script that will run daily? If so, how would you set it up?

    Any help would be greatly appreciated. Thanks in advance!



  • 2.  RE: Create a filter with powershell?

    Posted Feb 23, 2016 10:30 AM

    my thought:

    powershell feeds data into a webservice. Each computer has policy wit  a script that queries the webservice everyday with its primary user and computername or other local values. (we use PHP for this kind of webservice at my company).  in response it gets back a value for "manager name" which it writes into the registry.

    like

    DWORD  Valuename: manager: Value: Jsmith

    the second part of that policy is a custom inventory for that registry value that adds it to the custom inventory of that computer record.  for the ssake of example lets call that custom inventory table "manager_name"

    That way when you are making your filters all you would have to do it is set your SQL based filter to select all computers where manager name =jsmith as an example.

    if the computer checks the webservice on a schedule, it will write the current managers name into the registry and report it), then it will dynamically become a member of the current users managers filter.

    anyway that's how i would automate such a thing.  It might seem commplicated to set up initially but has the advantage of being truly automated and hands off.

    thanks

     

     



  • 3.  RE: Create a filter with powershell?

    Posted Feb 23, 2016 10:30 AM

    my thought:

    powershell feeds data into a webservice. Each computer has policy wit  a script that queries the webservice everyday with its primary user and computername or other local values. (we use PHP for this kind of webservice at my company).  in response it gets back a value for "manager name" which it writes into the registry.

    like

    DWORD  Valuename: manager: Value: Jsmith

    the second part of that policy is a custom inventory for that registry value that adds it to the custom inventory of that computer record.  for the ssake of example lets call that custom inventory table "manager_name"

    That way when you are making your filters all you would have to do it is set your SQL based filter to select all computers where manager name =jsmith as an example.

    if the computer checks the webservice on a schedule, it will write the current managers name into the registry and report it), then it will dynamically become a member of the current users managers filter.

    anyway that's how i would automate such a thing.  It might seem commplicated to set up initially but has the advantage of being truly automated and hands off.

    thanks

     

     



  • 4.  RE: Create a filter with powershell?

    Posted Apr 27, 2016 09:26 AM

    Hi,

     

    maybe you could go another route:

    If you have that data in Active Directory (Manager, directReports Attributes), this can be imported by the "Microsoft Active Directory Import", including the association from User to Manager. Since you have it in the Database now, it's quite easy to set up SQL based filters fitting your needs.