I'm running the code below with SAPIEN. It runs OK in Powershell alone. But in SAPIEN I get the following error below. I have full admin privilages. I've tried specifying a different container for the new user.
I would stay away from only allowing button_click events to hold your information to create accounts, which is why I recommend the separate function. We could make it work within that _click event, but if you ever wanted anything else to initiate a new account (Drop down menu, mouse-over of a certain area, etc), you wouldn't be able to call the _click event.
Lastly, I would recommend using the .Net way to name your fields.
$txtFirst is a textbox (txt) that holds information about the first name
$lblFirst is the label that goes right above the textbox to tell the user what to put in there
$drpFirst is a dropdown for first name
$lstFirst is a listbox
Every object in .Net has a different type of way to grab the information presented. You definitely need to keep track of the properties on the right side of your Powershell Studio window to see how to grab information.
One last thing, if you do any variable manipulation (Create Display Name from $txtFirst and $txtLast), it will only be available in that function. In order to make it globally available, you must give it the $global: assignment, like this: $global:txtFirst
HTH,
DH
ichibanto
ASKER
Hi I will try this tomorrow thank you so much you're great. Sapien is a mine field. Cheers.
ichibanto
ASKER
I still get this error. I've changed the code to the above snippet creating a new function.
Have you tried the new-qaduser command with the same -parentcontainer information? It looks like it doesn't like New-QADUser though. I would test in command line.
ichibanto
ASKER
I've tried it with different container information. I think I'm going to establish the command works alone first before retrying. The new function works great just shame about the container. Will report back Monday.
I've requested that this question be deleted for the following reason:
No longer required
Dale Harris
I'm not sure a cancel request makes sense on this one. If you decided to go a different way with the script, will you let us know? If you were able to figure out the issue, will you let us know the solution? We provided some pretty solid troubleshooting steps, so I'm not sure what happened.
ichibanto
ASKER
The solution I used was windows .net classes to provide a menu interface following the licence expiring on the sapien product. The .net method was provided by MS "scripting guy" plus other widely available sources. Thank you for everybody's assistance on this one.
Open in new window
I would stay away from only allowing button_click events to hold your information to create accounts, which is why I recommend the separate function. We could make it work within that _click event, but if you ever wanted anything else to initiate a new account (Drop down menu, mouse-over of a certain area, etc), you wouldn't be able to call the _click event.
Lastly, I would recommend using the .Net way to name your fields.
$txtFirst is a textbox (txt) that holds information about the first name
$lblFirst is the label that goes right above the textbox to tell the user what to put in there
$drpFirst is a dropdown for first name
$lstFirst is a listbox
Every object in .Net has a different type of way to grab the information presented. You definitely need to keep track of the properties on the right side of your Powershell Studio window to see how to grab information.
One last thing, if you do any variable manipulation (Create Display Name from $txtFirst and $txtLast), it will only be available in that function. In order to make it globally available, you must give it the $global: assignment, like this: $global:txtFirst
HTH,
DH