Hack Forums
[Shell] Powershell - Simple Network Program Launcher (Includes AD Access) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] Powershell - Simple Network Program Launcher (Includes AD Access) (/showthread.php?tid=5894325)



Powershell - Simple Network Program Launcher (Includes AD Access) - animalchub - Oct 11, 2018

I've been working on this off and on while I work. It converts PS to a vb form and used simply to launch programs on a users pc without the need to push.
The second script launches a form that will edit AD and allow you to edit members specific users at the user's desk.

Reasons I made this:
  • I created it because I'm a lazy admin.

  • I like all my programs to be listed under one area and only want to run-as admin once.



First make two js files with:
Code
[
   {"ProgramName":"Chrome", "FP":"\\\\andent.andersonsinc.com\\home\\Users$\\SG140984\\Work Notes\\Programs\\Google\\ChromeSetup.exe"},
   {"ProgramName":"", "FP":"Placeholder"}
]
In the body.

So how to use and properly configure.

Using the file paths to the two js files. Change any line with (\\Path\to\my.js) to whichever path you want. Then do the same for the other js file (\\Path\to\myCITRIX.exe) to the other script that was converted to exe. *How to convert PS to exe listed at bottom of the page.

Enter in your credentials to:
* I don't advise using this method as you should never post your username and password in plain text.
Code
$username = "Plaintext Username"
$password = "Plaintext Password"
Main Script
https://pastebin.com/w4NeEPDj

Change the Paths to the network js (\\Path\to\myCitrix.js) to whichever path you want.
Secondary Script
https://pastebin.com/gANDQVmL

*Convert to EXE
I would suggest converting the following Powershell code to an EXE using ps2exe
Use this for converting to EXE:
Code
powershell.exe -command "&'\\Path\To\ps2exe.ps1' -inputfile '\\Path\To\MainScript.ps1' -outputfile '\\Path\To\MainScriptOutput.exe'" -noConsole - requireAdmin



RE: Powershell - Simple Network Program Launcher (Includes AD Access) - VoIPv2 - Oct 14, 2018

One that isn't JS, that's a JSON file. Secondly to skip the JSON, you could just read 2 lines and do:

Split the two values and then have the information.
1: ChromeData::C:\Users\<Username>\Desktop\chrome.exe
2:Citrix_Info:C:\Citrix.exe

Also OP you might want to remove the company you work for. Looks like the scripts contains company name and your user ID for the company.


RE: Powershell - Simple Network Program Launcher (Includes AD Access) - animalchub - Oct 14, 2018

(Oct 14, 2018 12:04 PM)VoIPv2 Wrote:  One that isn't JS, that's a JSON file. Secondly to skip the JSON, you could just read 2 lines and do:

Split the two values and then have the information.
1: ChromeData::C:\Users\<Username>\Desktop\chrome.exe
2:Citrix_Info:C:\Citrix.exe

Also OP you might want to remove the company you work for. Looks like the scripts contains company name and your user ID for the company.

Opps yeah you're right. I'm new to JSON.