Solved

Environment Tab (AD Users and Computers)

Posted on 2015-01-12
4
269 Views
Last Modified: 2015-01-12
Hello,

In the Environment Tab in AD Users and Computers, there is a check box to 'Start the following program at logon'.  I am looking for a script or query to show all users that are configured with this box checked.

Can anyone point me in the right direction?

Thanks,

TB
0
Comment
Question by:TropicalBound
4 Comments
 
LVL 13

Expert Comment

by:Alexios
ID: 40544830
Hello
Sorry but can you please be more specific in what exactly you need

Thank you
0
 
LVL 6

Assisted Solution

by:Kiran Ch
Kiran Ch earned 250 total points
ID: 40544912
Hi,

You would need to query the attribute value called "TerminalServicesInitialProgram".
This below gives you exactly what you are looking for.
https://social.technet.microsoft.com/Forums/windowsserver/en-US/a82f326f-c2a6-4f57-85b8-f9f5c2063b46/use-powershell-to-read-environment-tab-checkbox-from-aduc?forum=winserverpowershell
0
 
LVL 32

Accepted Solution

by:
it_saige earned 250 total points
ID: 40545122
You could run the following powershell script based on the above recommendation:
$users = Get-AdUser -Filter *
Foreach($usr in $users)
{
    $u=Get-ADUser $usr
    $user = [adsi]"LDAP://$($U.DistinguishedName)"
    try
    {
        $user.PSBase.Invokeget("TerminalServicesInitialProgram")
    }
    Catch
    {
        if($_.exception.message -like "*The directory property cannot be found*")
        {
            write-host "$usr hasn't been set this option"
        }
    }
}

Open in new window

-saige-
0
 
LVL 3

Author Closing Comment

by:TropicalBound
ID: 40545187
Exactly what I needed!

Thanks to you both!
0

Featured Post

Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now