adsi

ADSI will not connect to IIS from XP Workstation

非 Y 不嫁゛ 提交于 2019-12-02 12:51:12
I'm successfully using VBScript within WScript to remotely read and write IIS configurations from the server. When I attempt to run these same scripts from my desk box they fail, though. Example: Dim vdir Set vdir = GetObject("IIS://servername/w3svc/226/root") Error = "Invalid syntax" The code works perfectly when run from one IIS server to another, but I'd like to run it from my XP Workstation. It would seem reasonable that there's a download of ADSI available that will make things work from my desktop, but I cannot find one. I downloaded ADAM but that only got me a small portion of the

Add logon program for TSclients in environment tab user adsi in Powershell

时间秒杀一切 提交于 2019-12-01 12:10:24
Hi I'm tring to set a logon program parameter for remote clients that will be created using a powershell script. As shown below I managed to get a logon script to set in the profile tab using $objUser.PSBase.InvokeSet('LoginScript', "logoff.cmd") As seed in this thread here The problem is I can't find the attribes in ADSIedit also some attrribes that I use and work aren't shown in ADSIedit such as PasswordExpired which leads me to believe the attribute does exsist. Below is my code $objComputer = [ADSI]"WinNT://127.0.0.1" $objUser = $objComputer.Create('user', $username) $objUser.SetPassword(

Query AD Group Membership Recursively Through SQL

北慕城南 提交于 2019-11-29 10:23:11
Background I'm creating some SQL to assist with security auditing; this will take security info from various systems databases and from Active Directory and will produce a list of all anomalies (i.e. cases where accounts are closed in one system but not others. Current Code To get a list of users who are a member of a security group I run the below SQL: if not exists(select 1 from sys.servers where name = 'ADSI') EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject', 'adsdatasource' SELECT sAMAccountName, displayName, givenName, sn, isDeleted --, lastLogonTimestamp --

When do I need a Domain Name and a Domain Container to create a PrincipalContext?

旧城冷巷雨未停 提交于 2019-11-29 08:05:41
I'm developing a C# .NET Framework library to access active directory. One of the things that I have to do is to get all AD users, and I see that: PrincipalContext principalContext = new PrincipalContext(ContextType.Domain, domainName.Trim(), domainContainer.Trim()); And PrincipalContext principalContext = new PrincipalContext(ContextType.Domain); Returns the same users with this code: // define a "query-by-example" principal - here, we search for all users UserPrincipal qbeUser = new UserPrincipal(principalContext); // create your principal searcher passing in the QBE principal

Query AD Group Membership Recursively Through SQL

落花浮王杯 提交于 2019-11-28 03:46:42
问题 Background I'm creating some SQL to assist with security auditing; this will take security info from various systems databases and from Active Directory and will produce a list of all anomalies (i.e. cases where accounts are closed in one system but not others. Current Code To get a list of users who are a member of a security group I run the below SQL: if not exists(select 1 from sys.servers where name = 'ADSI') EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject',

When do I need a Domain Name and a Domain Container to create a PrincipalContext?

守給你的承諾、 提交于 2019-11-28 01:49:02
问题 I'm developing a C# .NET Framework library to access active directory. One of the things that I have to do is to get all AD users, and I see that: PrincipalContext principalContext = new PrincipalContext(ContextType.Domain, domainName.Trim(), domainContainer.Trim()); And PrincipalContext principalContext = new PrincipalContext(ContextType.Domain); Returns the same users with this code: // define a "query-by-example" principal - here, we search for all users UserPrincipal qbeUser = new

Memory Leak when using DirectorySearcher.FindAll()

左心房为你撑大大i 提交于 2019-11-27 20:29:07
I have a long running process that needs to do a lot of queries on Active Directory quite often. For this purpose I have been using the System.DirectoryServices namespace, using the DirectorySearcher and DirectoryEntry classes. I have noticed a memory leak in the application. It can be reproduced with this code: while (true) { using (var de = new DirectoryEntry("LDAP://hostname", "user", "pass")) { using (var mySearcher = new DirectorySearcher(de)) { mySearcher.Filter = "(objectClass=domain)"; using (SearchResultCollection src = mySearcher.FindAll()) { } } } } The documentation for these

IIS application using application pool identity loses primary token?

痞子三分冷 提交于 2019-11-27 06:20:28
(This is a question about a vague problem. I try to present all relevant data, in the hope that someone has helpful information; apologies for the long description.) Our web app We have a .NET 4 web application running in IIS 7.5 accessing Active Directory and a SQL Server database. This web application is running under a virtual 'app pool identity', by setting the Identity of the application's application pool to ApplicationPoolIdentity . A concise description of virtual identities can be found in a StackOverflow answer , and the blog post to which it refers: an app pool identity is just an

Active Directory user password expiration date .NET/OU Group Policy

人盡茶涼 提交于 2019-11-27 04:51:37
I have searched the site for information and found this: ASP.NET C# Active Directory - See how long before a user's password expires which explains how to get the value of when the password expires as per Domain Policy. My question is this: what if the user has an OU Group Policy that has a different MaxPasswordAge value, overriding the one specified in Domain Group Policy? How to programatically get the OU's Group Policy Object? Edit: To make this question a little bit more clear, I am adding this edit. What I am after is to being able to tell when user's password expires. As far as I

Memory Leak when using DirectorySearcher.FindAll()

跟風遠走 提交于 2019-11-27 04:27:13
问题 I have a long running process that needs to do a lot of queries on Active Directory quite often. For this purpose I have been using the System.DirectoryServices namespace, using the DirectorySearcher and DirectoryEntry classes. I have noticed a memory leak in the application. It can be reproduced with this code: while (true) { using (var de = new DirectoryEntry("LDAP://hostname", "user", "pass")) { using (var mySearcher = new DirectorySearcher(de)) { mySearcher.Filter = "(objectClass=domain)"