WMI for User Profile Disk (UPD)

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 ?????
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
select * from Win32_OperatingSystem WHERE (ProductType <> "2") AND (ProductType <> "3")
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
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.

       |                         |
  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.
dkSoftwareAuthor Commented:
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 !
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

dkSoftwareAuthor Commented:
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
dkSoftwareAuthor Commented:
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
dkSoftwareAuthor Commented:
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

It´s something so obvious I should be seeing what the issue is !!!!
So frustrating when you know it is something simple
dkSoftwareAuthor Commented:
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 ?
David Johnson, CD, MVPOwnerCommented:
that filter only is good for any CLIENT Operating systems.
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
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?
dkSoftwareAuthor Commented:
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
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
Understood. OU membership would serve.

Create two OUs:

Users connecting to the setup using UPDs would be in NewRDS while those connecting to pre-2012 would be in OldRDS.

Link the redirection policy to the OldRDS OU.

Users in NewRDS will _not_ get their folders redirected.

That's the simplest way to do it.

Otherwise, create the WMI filter David suggested above and set it in the GPO scope settings. Will it work that way on a User based GPO? I'm not too sure it will.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dkSoftwareAuthor Commented:
Would solve the issue when Loopback processing of Group Policy is enabled.
dkSoftwareAuthor Commented:
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 !!
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.