Search found 49 matches

by daviesg6
Tue Feb 04, 2014 7:07 am
Forum: PowerShell
Topic: Get-adobject doesn't work using GUI
Replies: 17
Views: 14062

Re: Get-adobject doesn't work using GUI

Here is what I previously had, this creates a menu in the Powershell window. It works fine, but I have been asked to make it a form rather than "a command line operation" This works perfectly. Import-Module ActiveDirectory $prompt = @" *************************************************...
by daviesg6
Tue Feb 04, 2014 6:46 am
Forum: PowerShell
Topic: Get-adobject doesn't work using GUI
Replies: 17
Views: 14062

Re: Get-adobject doesn't work using GUI

The script, without the variables created by primalforms to identify the various form elements, works fine for me. The thing is this ONLY breaks when I use the powershell code created by primalforms. that's why I'm getting frustrated with the code, it works if I don't use the form but I need to crea...
by daviesg6
Tue Feb 04, 2014 6:43 am
Forum: PowerShell
Topic: Get-adobject doesn't work using GUI
Replies: 17
Views: 14062

Re: Get-adobject doesn't work using GUI

jvierra wrote:Works for me.

What is $input?

$input is a special variable. Perhaps you shouldn't use it.
$input is the text box where the user enters the name they are searching for. without this the entire form is useless
by daviesg6
Mon Feb 03, 2014 2:45 pm
Forum: PowerShell
Topic: Get-adobject doesn't work using GUI
Replies: 17
Views: 14062

Re: Get-adobject doesn't work using GUI

I had already removed it from the script, the problem is even with the extra } removed, it still gives Get-ADObject : The search filter cannot be recognized At H:zzUntitled14.ps1:51 char:20 + $results.Text=Get-ADObject -Filter "displayName -eq '$($input.text)'" -Incl ... + ~~~~~~~~~~~~~~~~...
by daviesg6
Mon Feb 03, 2014 1:31 pm
Forum: PowerShell
Topic: Get-adobject doesn't work using GUI
Replies: 17
Views: 14062

Re: Get-adobject doesn't work using GUI

Isn't there an extra } in there? (highlighted in red below) $Search_OnClick={ $results.Text=Get-ADObject -Filter "displayName -eq '$($input.text)' } " -IncludeDeletedObjects | Out-String $Results.Focus() } If I remove that I again get Get-ADObject : The search filter cannot be recognized A...
by daviesg6
Mon Feb 03, 2014 11:48 am
Forum: PowerShell
Topic: Get-adobject doesn't work using GUI
Replies: 17
Views: 14062

Re: Get-adobject doesn't work using GUI

I've been playing with this, and now get a little closer, the issue now is it tells me Method invocation failed because [System.String] does not contain a method named 'Focus'. At line:52 char:6 + $Results.Focus() + ~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + Fully...
by daviesg6
Mon Feb 03, 2014 9:29 am
Forum: PowerShell
Topic: Get-adobject doesn't work using GUI
Replies: 17
Views: 14062

Re: Get-adobject doesn't work using GUI

Again, thank you. I tried the code you posted, it now gives the same error I previously had. The link you sent is useful, but it still seems I can either have an error or no results :(
by daviesg6
Mon Feb 03, 2014 7:12 am
Forum: PowerShell
Topic: Get-adobject doesn't work using GUI
Replies: 17
Views: 14062

Re: Get-adobject doesn't work using GUI

Thanks, I no longer get the error, but I don't get any output either. I guess I now need to work on getting the output in the results box. While I try to work that one out, anyone have any suggestions that may help get this result?
by daviesg6
Fri Jan 31, 2014 2:35 pm
Forum: PowerShell
Topic: Get-adobject doesn't work using GUI
Replies: 17
Views: 14062

Get-adobject doesn't work using GUI

So, I used PrimalForms to create GUI for a coworker who doesn't like command line. I wrote him a nice menu based script but because it was still in the Powershell window he sulked. The script, when not included in a form/GUI, searches AD, including deleted items for a user object. You then have the ...