Link to home
Start Free TrialLog in
Avatar of dkSoftware
dkSoftware

asked on

WMI for User Profile Disk (UPD)

Hi,
I was going to create a WMI filter for GPO to exclude servers from a policy that has User Profile Disks enabled
so users logging on would not get a redirection policy.
This would be the best case while we migrate users between servers !!!

BUT I just can´t find where to locate this with WMI

Any ideas ?????
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

select * from Win32_OperatingSystem WHERE (ProductType <> "2") AND (ProductType <> "3")
https://www.experts-exchange.com/articles/18463/WMI-Filtering.html
WMI filtering is more for designating GPO settings at the domain level to certain operating systems, machine types, device types, and such.

The best way to accomplish this is to have the users grouped into an OU structure that allows for cascaded settings via GPO.

                 ROOT
       |                         |
  BRANCH           BRANCH
 |            |          |            |
  OU1     OU2     OU3      OU4

Based on the above OU structure we could link GPO settings to each OU and the settings would be delivered based on the user's location.

EDIT: In a migration scenario as mentioned the ROOT OU would be a new structure with new GPOs set up with the needed settings.

We'd move a small batch of users from their original OU to their new one so as to not kill the network for the redirected folders move.
Avatar of dkSoftware
dkSoftware

ASKER

Hi David,
That would just say that that it´s a server so that would not help :(

I am trying to locate this with powershell in settings because this User profiles disks are set on server (Collection)

gwmi -Namespace "root\cimv2\TerminalServices" -Class Win32_TerminalServiceSetting

but I am not finding it !
Hi Philip,
The reason why I am looking for this ability is to simplify the process and users can migrate to the new enviorment with out to much administrative effort
Might be a workaround to check if the server is a member of a Collection then filter out

gwmi -Namespace "root\cimv2\TerminalServices" -Class Win32_TSSessionDirectory

Caption                                    :
Description                                :
GetLoadBalancingState                      : 1
GetServerWeight                            : 100
GetTSRedirectorMode                        : 0
InstallDate                                :
Name                                       :
PolicySourceLoadBalancing                  : 0
PolicySourceSessionDirectoryActive         : 0
PolicySourceSessionDirectoryClusterName    : 0
PolicySourceSessionDirectoryExposeServerIP : 0
PolicySourceSessionDirectoryLocation       : 0
SessionDirectoryActive                     : 1
SessionDirectoryClusterName                : SomeCollection
SessionDirectoryExposeServerIP             : 0
SessionDirectoryIPAddress                  :
SessionDirectoryLocation                   : sb01.domain.LOCAL;sb02.domain.LOCAL
Status                                     :
PSComputerName                             : XXXXXXXXXXXXXXXX

Now to make that work I will need to create WMI Query
I would think having the Namespace root\cimv2\TerminalServices
and query
select * from Win32_TSSessionDirectory where SessionDirectoryClusterName <> ''
Would work but I get invalid class using WBEMTest

User generated image
It´s something so obvious I should be seeing what the issue is !!!!
So frustrating when you know it is something simple
SELECT * FROM Win32_TSSessionDirectory WHERE SessionDirectoryLocation LIKE "%SB%"
Works on some servers and on other I get 0x80041010 Invalid Class
where I use the WHERE clause !!

But the class is there and has a value, ANY Ideas what could be causing that ?
that filter only is good for any CLIENT Operating systems.
We've done a lot of migrations both within domain, old domain to a newly set up domain (side-by-side), and a few others.

The method I indicated is the method we use within a domain when migrating AD from-to along with data, databases, and such.

Why reinvent the wheel and look for a complicated answer when this one is so simple?
Hi Philip Elder,
We are not migrating from a old domain to a new.
What I am looking for is to have different behavior for users depending what Computers they are connecting to.
Because on the new RDS we use User Profile Disk and on the older ones we do not have them so a redirection policy should be used.
That is why we wanted to detect UPD and apply accordingly
ASKER CERTIFIED SOLUTION
Avatar of Philip Elder
Philip Elder
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Would solve the issue when Loopback processing of Group Policy is enabled.
Philip,
That would solve the issue.
We did create two duplicate policies with WMI filter for windows 2008 r2 and older
and the second one was windows 2012 and later with RDS off

That also works for us but I will definetly look at using your solution instead !!
We do _not_ use Loopback in any of our Group Policy structures.

It's very risky and sometimes the results are not predictable.

We use machine based GPOs linked to OUs with machines and user based GPOs linked to OUs with users in them.