Jump to content

Active Directory Problems


scarboni
 Share

Recommended Posts

Hello there,

I just came across a problem while i was using a simple code contaning run as when im running Active directory. I cant change password on users if i write the following code. If i do a normal run as on the file i can change the password on a ad user but not when im running this code snippet.

RunAs($Username, $Domain, $Password, 0, @ComSpec & " /c " & 'dsa.msc', "", @SW_HIDE)

Help please :graduated:

Edited by scarboni
Link to comment
Share on other sites

You could use my Active Directory UDF to do what you need (for download please see my signature).

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

You could use my Active Directory UDF to do what you need (for download please see my signature).

I read through your UDF a bit, is it able to connect to the Active Directory and search, reset passwords and manage accounts? Im working at a company as a IT dekstop engineer and i created a program named AdminIT which runs AD as the engineers admin account it works to search through the AD but i cannot reset passwords and i suppose i cant create accounts with it either.

Edited by scarboni
Link to comment
Share on other sites

Connect: _AD_Open - you can specify the credentials to use

Search: Function _AD_GetObjectsInOU

Reset password: Function _AD_SetPassword

Manage accounts: Depends on what you want to do

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Yes. If you create your own GUI you can limit the user to the necessary functions.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

The idea is to get full access to the original AD program, I sure could build my own AD GUI and create most of the functions with your UDF but it would be kinda redundant to invent the wheel once again when all i just want to do is access the program :graduated: But if it's not possible to use all the functions inside the original AD i probably will have to create my own :S

Or I could make a ugly solution where I open the Systemdir and locate dsa.msc and send shift + right mouse button and select run as, check the run as another user and enter the needed information.

Link to comment
Share on other sites

This code works but its a ugly solution :S

$domain = "domain"
$username = "user"
$password = "password"
send("#r")
WinWaitActive("Run")
ControlSetText("Run", "","[CLASSNN:Edit1]","c:\windows\system32")
send("{ENTER}")
ControlFocus("system32", "", "SysListView321")
sleep(500)
Send("dsa.",1)
Send("{APPSKEY}")
Sleep(100)
send("u")
winwaitactive("Run as")
ControlCommand("", "", "Button3", "Check")
Sleep(500)
ControlSetText("Run as", "","[CLASSNN:Edit1]",""&$domain&"\"&$username)
ControlSetText("Run as", "","[CLASSNN:Edit2]",""&$password)
send("{ENTER}")

Also found out another solution which worked better.

Send("#r")
  ControlSetText("Run", "", "[CLASSNN:Edit1]", "runas /user:"&$DomainCheck&"\"&$UNCheck&' "mmc %windir%\system32\dsa.msc"')
  Send("{ENTER}")
  WinWaitActive(@WindowsDir &"\system32")
  Send($PWCheck ,1)
  Send("{ENTER}")
Edited by scarboni
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...