adsi

ADSI Query against IIS does not agree with IIS Manager, on Vista

纵然是瞬间 提交于 2019-12-11 10:43:04
问题 Using Vista... I have a script that uses ADSI to set ScriptMaps on an IIS Website. It's javascript, run within cscript.exe, and the code looks something like this: var web = GetObject("IIS://localhost/W3SVC/1"); var maps = web.ScriptMaps.toArray(); map[maps.length] = ".aaa,c:\\path\\to\\isapi\\extension.dll,1,GET,POST"; web.ScriptMaps = maps.asDictionary(); web.SetInfo(); When I look in the IIS Manager after running the script, I can see the new entry in the list of Handler Mappings. It has a

Can not reference a Dll that worked earlier

自闭症网瘾萝莉.ら 提交于 2019-12-11 07:38:14
问题 I am trying to change the Terminal Services settings programmaticly. I learned that you must use tsuserex.dll. Being c# i ran tsuserex through tlbimp and created TSUSEREXLib.dll then registered it with regasm. I got it working and wrote a framework program with it as a prof of concept. However today after I made some changes when I run my program I get the error Unable to cast COM object of type 'System.__ComObject' to interface type 'TSUSEREXLib.IADsTSUserEx'. This operation failed because

“A referral was returned from the server” error only while querying LDAP from outside the domain

陌路散爱 提交于 2019-12-11 03:22:45
问题 I have 2 domains in the forest. 2nd one is the child domain of the first one. Like below... Domain1 = abc.com on machine machine1 Domain2 = child.abc.com on machine macnihe2 I have c# application which tries to create a DirectoryEntry on the child domain. LDAP://machine1/OU_IN_CHILD_DOMAIN/PARENT_DOMAIN_USERNAME_AND_PASSWORD This works when my c# application is on parent domain i.e on abc.com but if my c# application is on any un-related domain like unrelateddomain.com , I get A referral was

Change AD Password using PHP/COM/ADSI/LDAP

☆樱花仙子☆ 提交于 2019-12-10 22:36:36
问题 I've been stumped on this for a couple days now. I've tried various solutions to no avail. Please help... Problem: We have two domain controller, which are not under our management. We are able to connect via LDAP on port 389, but are not able to connect securely over port 636. We are developing a system to allow a number of self-service facilities, one of which is a password recovery tool. This works up to the point of resetting the users password. I have found some code via the PHP manual

Programatically removing etag suffix (change number) from the metabase IIS6

霸气de小男生 提交于 2019-12-10 20:16:25
问题 IIS 6.0 generates eTag values in the format of "hash:changenumber". The changenumber goes up every time IIS resets, so your eTag is only valid for the lifetime of your IIS process. Restart, number goes up, hash:changenumber != hash:changenumber+1. The fix for this is to hard-code the changenumber, which is possible using the Metabase Explorer, a .NET utility for editing the metabase, or by editing the XML file when the IIS services are stopped. I want to do this programmatically, with the

System.__ComObject instead of active directory values

拥有回忆 提交于 2019-12-08 13:45:28
I tried to fetch LDAP user information using asp . But I get System.__ComObject instead of active directory values. Please help me to solve this . CODE I'm getting System.__ComObject instead of active directory values . Please help me to solve this error . 来源: https://stackoverflow.com/questions/56021248/system-comobject-instead-of-active-directory-values

Setting the LastPasswordSet date for a user in Active Directory

ぐ巨炮叔叔 提交于 2019-12-08 07:18:33
问题 I want to set the LastPasswordSet attribute of a user in Microsoft Active Directory. The .NET UserPrincipal API exposes the LastPasswordSet property as readonly. Is there a way around this, to set the value (perhaps using ADSI)? Edit: MSDN provides the following example code: usr.Properties["pwdLastSet"].Value = -1; // To turn on, set this value to 0. usr.CommitChanges(); This forces the user to change their password at next logon. I presume if I replace -1 with a date-time in the relevant

[ADSI]::Exists throws an exception instead of returning False

↘锁芯ラ 提交于 2019-12-07 05:02:22
问题 I'm trying to create a user using the ADSI object if it doesn't already exist. Here are the strange results I'm getting #Check a user that I know exists [ADSI]::Exists("WinNT://localhost/micah,user") #True #Check a group that I know exists [ADSI]::Exists("WinNT://localhost/administrators,group") #True #Check a group that DOESN'T exist [ADSI]::Exists("WinNT://localhost/whoops,group") #False #Check a user that DOESN'T exist (NOT specifying that the obect is a user) [ADSI]::Exists("WinNT:/

Updating Active Directory user properties in Active Directory using Powershell

谁说我不能喝 提交于 2019-12-06 06:30:32
问题 In a Windows Server 2003 R2 environment, using Powershell v2.0, how would one duplicate the functionality of Set-QADUser to update user properties in Active Directory, like their phone number and title? The trick here being, I would like to do this without depending on Set-QADUser and I do not have the option to use the Server 2008's commandlets, yet. Thanks. 回答1: Piecing things together from around the internet, I came up with this... function Get-ADUser( [string]$samid=$env:username){

LDAP group membership (including Domain Users)

亡梦爱人 提交于 2019-12-06 06:02:26
问题 How can I get a list of users within an LDAP group, even if that group happens to be the primary group for some users? For example, suppose "Domain Users" is "Domain Leute" in German. I want all members of "CN=Domain Leute,DC=mycompany,DC=com". How would I know that is the well-known "Domain Users" group? Or what if some users' primary group was changed to "CN=rebels,DC=mycompany,DC=com", and I wanted to get members of THAT group? Users don't have a memberOf property for their primary group,