This topic contains 2 replies, has 2 voices, and was last updated by
July 20, 2015 at 5:52 am #27676ParticipantPoints: 0Rank: Member
I installed PSWA so that my remote technical users have access to some admin functions, like reset office 365 user password, restart application service, etc...
But i don't want they have access to all powershell cmdlets and build them own sintax, i wrote a script that builds a little menu with these options and make easy for them choose what they want and don't do wrong things.
I wanted this script runs automatically after the login in pswa... so they can't do anything that isn't provided.
I tried use the startupscript in PSSessionConfiguration but i have read-host prompt in my script that waits the user for insert any menu options, the login in PSWA failed, because the startup script needs to run and finish before powershell windows was rendered to browser.
Someone knows how can i run anything after login so that i can provide this menu for my users?
Thanks e sorry for my bad english.
July 20, 2015 at 6:04 am #27677KeymasterPoints: 1,811Rank: Community Hero
You're going about this the wrong way. Even if you make your menu work, it's easy to cancel the menu and do whatever.
The correct approach is to create a new Remoting endpoint that only contains the commands you want. PSWA has the ability to connect to a named endpoint, and so your technicians would connect to whichever one you tell them to. Remove their permissions to connect to the default endpoint.
"Secrets of PowerShell Remoting" (Resources / eBooks menu on this site) explains custom Remoting endpoints.
July 20, 2015 at 7:35 am #27681ParticipantPoints: 0Rank: Member
Thats not what happen... when i run the menu function manually, i can't cancel it... the close menu option run the exit command thats logoff the user from pswa.
i'm studying this option to create a new endpoint, but still allows users to create them own syntax and they can do more than just reset users passwords in office 365 case. With my script the reset is easy and controlled.
The topic ‘Run script after session login in PSWA’ is closed to new replies.