Powershell n00b question

2 posts in this topic

#2 ·  Posted

Try :


Run ( Powershell [Powershellcommands] )

Or click on my nickname < Caramen i am coding alot of powershell things ATM and requested a lot of helps

I am sure you gonna find something


Also you have to check out your AD rights ; The powershell restriction of the computer ; etc....

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

  • Similar Content

    • caramen
      By caramen
      !Arf it i used [Start new topic] when i was in GUI section and the post was moved without i even noticed it. Can an admin move that to general (SORRY)!
      Hello guys ME again and my ugly english xD.
      This is the only one powershell command i am not able to use becose i dont found a way to insert the USERNAME $Variable at the first line. i am not able to find a third way to QUOTE a variable when i use "*" for the AutoIt command and the '*' for the PS command but i need to QUOTE inside the '*'PS command my $Variable
      $iPid = run("powershell get-aduser -Filter {sn -eq 'USERNAME'} -Properties sAMAccountName,Title" , @WindowsDir , @SW_HIDE , 0x2) $AllInfo = "" While 1 $AllInfo &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $AllInfo = stringsplit($AllInfo , @LF , 2) ;split result in all @LF but don't use the splitted result for anything _ArrayDisplay($AllInfo) This gonna be my last question becose i can do all the rest (i guess & wish ) alone
    • caramen
      By caramen
      I improved my powershell skill like F**** !! I am so happy Level skill under beginner HAHA well i am just getting what i want but now i got a question about autoit + powershell
      When i run that Shellcommand 
      $iPid = run("Powershell Get-ADUser USER -Properties * | select -Expand Title"  , @WindowsDir , @SW_HIDE , 0x2)
      The return valu is :
      Micro r,seau (this is normal in PowerShell)
      Can i transform the value
      Micro réseau with autoit 
    • profyt7
      By profyt7
      Hey Guys,
      I am almost there but feel I am missing something that is right in front of me and need another set of eyes.
      I am trying to run the following powershell file with the following parameters. This works in powershell just fine.
      Reset-LocalAdminPassword.ps1 -Password $secureString
      I created an autoit script to do a few other things but from venturing in the forums I found some code and did the following:
      ;THIS COMMAND WILL RUN THE powershell script
      $iDir = "C:\test\script\Reset-LocalAdminPassword.ps1"
      Run('cmd /k C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File ' & '"' & $iDir & '-Password $secureString')
      The problem is that when it runs it gives me a message that C:\test\script\Reset-LocalAdminPassword.ps1-Password $secureString' is not a valid ps1 file.
      I cannot seem to get it to run the ps1 file with the -Password $secureString' parameter. It keeps cobining the ps1 path and the parameters all as one.
      I am sure this is something I am overlooking but I have been battling with this for a few hours now and just don't know what I am missing.
    • ViciousXUSMC
      By ViciousXUSMC
      I have messed with this time to time, but recently decided to go ahead and push it out because I have so many people having the default reader app take over adobe and since they are not admins they cant easily change the default program to adobe for their profile.
      To remove the app for the current user I use.
      get-appxpackage | where name -like '*reader*' | remove-appxpackage If it is a new computer build I can remove the app from the system so it does not install for any new users with this.
      get-provisionedappxpackage -online | where displayname -like '*reader*' | remove-appxprovisionedpackage -online So where I am stuck is getting it off existing accounts on computers in the field.  Every article, document, etc I can find says all you need to do is add the -allusers flag.
      If I add the flag to the get package part it does show the package for each user, but when I pipe it into the remove-package cmdlet I get an error that the package is not installed for the current user and it does not uninstall it for any other account.
      This is what I have tried:
      get-appxpackage -allusers | where name -like '*reader*' | remove-appxpackage Also a revision of it
      get-appxpackage -allusers *reader* | remove-appxpackage As far as I can tell, this is correct but simply is not working. 
      Any ideas or anybody know what the key issue that I am overlooking is?
    • bstjohn
      By bstjohn
      I'm running AutoIT v3.3.14.2 on Windows 10 ver 1511.  The September Cumulative Update from Microsoft has broken the way some third party credential providers work.  You can see more detail here:
      So I want to automatically and silently remove this update from all our machines.  In Windows 7 I could easily do it with this:
      wusa.exe /uninstall /kb:3185614 /quiet
      But apparently Microsoft has taken away the /quiet switch functionality in Windows 10.   wusa /? will show that the switch is there, but when trying to use it error 87 (invalid parameter) is returned.
      So I relented on that point and decided to run wusa without the quiet switch.  It pops up a child window that prompts for confirmation before uninstalling the update.  Sounds like a perfect job for AutoIT, right?  Except I can't get the button to click, either using ControlClick or ControlSend or Send.  I can select it by sending the {Alt} key to it and it highlights.  But I just can't get it to accept the click or {Enter}.
      I then tried using Powershell and DISM to remove the package, but this is a hotfix and doesn't have a package name, so I can't use dism /remove-package, either.
      Does anybody have any other ideas how this can be done silently?