Sign in to follow this  
Followers 0
scarboni

Active Directory Problems

10 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



All managementsoftware in Windows are "immune" to virtual keystrokes etc..

Computer Management

Local Group Policy Editor

Registry Editor

etc etc


Challenge accepted!

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Am I able to run the AD through the CMD by just adding the original run as command and being able to reset passwords?

Runas /user:Domain\Username "dsa.msc"

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I would like to get access to this window

Posted Image

If im using your UDF i will have to build my own GUI for it right?

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0