Questions tagged as 'powershell'

1
answer

Search for 2 occurrences in powershell

How can I do to find 2 occurrences together in a determination file using powershell? $p = @("string1","string2") get-content C:\log.txt | Select-String -Pattern $p Above, the expression returns me the occurrences that have one OR string...
asked by 30.10.2017 / 14:54
1
answer

Shell Script - Refresh page every 5 minutes

I need to update a webpage (eg www.google.com) every 5 seconds, as I have no idea how to do this script. Can anyone help me? Thank you     
asked by 22.07.2016 / 18:26
1
answer

Powershell - the use of wildcard or similar thing in Set-MailboxJunkEmailConfiguration

I've been trying to figure out on my own, from researching on various websites, forums etc, a solution I deem to be relatively simple, but without success. I would like to block emails for a particular Exchange user, but not by the entire add...
asked by 21.10.2015 / 12:42
1
answer

Running script on XP machines

I have a script running properly on machines 7, but XP does not run. If it runs locally, it does what it wants, but via GPO it does not. The script checks the computer's OU, scans a .csv file, and places its icons on the user's desk...
asked by 09.03.2015 / 16:21
0
answers

SQL and xp_cmdshell

Good people, I have this little SQL code: DECLARE @StringRTF VARCHAR(MAX), @Posh VARCHAR(8000) SET @StringRTF = (select traduçao from artigos where Cod_Art='01010066') select @StringRTF SET @Posh = 'powershell.exe -ExecutionPolicy ByPass -C...
asked by 07.12.2018 / 16:07
0
answers

How to run a .php file from the server using Windows PowerShell?

Hello friends, I have already logged in to Windows PowerShell but I am not able to run a file that is in socket / test.php that is on the server of my hosting. I type: php -q socket/teste.php in return me Could not open input file: tes...
asked by 29.11.2018 / 21:15
1
answer

Powershell (new-object System.Net.WebClient) .DownloadFile Strings as Arguments

I have the following code that I use to download the last chromedriver to a specific folder: (new-object System.Net.WebClient).DownloadFile("https://chromedriver.storage.googleapis.com/$($ChromeDriverLatestVersion)/chromedriver_win32.zip", "...
asked by 28.11.2018 / 20:21
0
answers

Remove a user from a group in AD using .net + powershell

Hello, I'm trying to remove users from a group in AD from a PowerShell script, inside an ASP.NET MVC application. I have a similar script and function to add a user in AD, but it is not working to remove users. Here is my script and my functi...
asked by 23.10.2018 / 21:29
0
answers

List print server printers installed from a remote station

Work in a company that has the following structure: Each city in my state has a head office with a server that is also a print server, the printers are located here. I use the Systernals psexec together with a command to install the printe...
asked by 06.09.2018 / 20:15
1
answer

Search and copy file using PowerShell ISE

To copy png image files from one disk to another, we use: Copy-Item "D:\" -Filter "*.png" -Destination "F:\Files_PNG" -Recurse -Force Copy the files and directory structure. What parameters to use to not copy Directories and Subdirectories...
asked by 07.09.2018 / 05:23