Questions tagged as 'powershell'

0
answers

Change NTFS permission by UNC using PowerShell

I am trying to modify an NTFS permission to a folder located on a server. I only have access to the server through UNC and I have permissions to administer NTFS security. I'm trying the following code: $Pathv6 = '\MyHostname\folder' $acl =...
asked by 06.07.2018 / 09:16
2
answers

Problem with foreach powershell

I have a small problem with a powershell script ... I'm learning how to program and I do not know how to solve it. $descargas = "C:/Maqueta" if(Test-Path -Path $descargas -PathType Container){ Write-Host "El directorio $descargas ya esxis...
asked by 19.06.2018 / 09:34
0
answers

Initiate an RDC interactively on a scheduled basis

I have a powershell script to log in to an RDC. This script introduces the credentials and everything and leaves the virtual machine's desktop ready to use. I need this script to be executed by another virtual machine from the scheduled tasks...
asked by 15.06.2018 / 14:55
0
answers

Powershell credentials loop

When working with a powershell project, I found myself with a credential problem and the following error: Invoke-RestMethod : {"error":"bad_request","reason":"[{key_missing,ackmode}]"} Browsing the internet I found a solution that consisted...
asked by 17.05.2018 / 11:25
1
answer

Run powershell scripts from Windows Forms C #?

I need to run the following command that is in an auth.ps1 file $session = New-PSSession -ComputerName 'SRV2KDC.microsspr.local' -Credential (Get-Credential) Invoke-Command $session -Scriptblock { Import-Module ActiveDirectory } Import-PSSessi...
asked by 11.05.2018 / 18:58
0
answers

Connect PC to Active Directory domain

I am trying to join a domain to my computer using powershell and this gives me the following error:    The computer 'PC17142' could not join the domain 'virtualbox.local' from its current working group 'WORKGROUP' with the following error mes...
asked by 24.04.2018 / 09:35
0
answers

Run a PowerShell script with multiple parameters

I have a script that I need to run on the server from the client, which I do using Invoke-Expression to execute a WMIC command. em> and create a process " cmd / c ". On the server I have the script and one of its parameters receives...
asked by 01.04.2018 / 18:28
1
answer

Delete files without removing the folder tree in PowerShell

I have this script written in Powershell to delete files from a server using its creation date. $datapath = "C:\Users\Alumno\Desktop\test" dir $datapath| ?{($_.creationtime.adddays(2) -lt (get-date))} | remove-item -force -Recurse How could...
asked by 05.02.2018 / 18:45
1
answer

How to create a Direct Access to an FTP address with a bat file (or VB.NET code)?

What I want to do is a direct access to an FTP site, for users to run the .Bat and automatically create Direct Access on their desktops and open the FTP site with Windows Explorer. I hope you can help me. Edit: I can also use a code in VB....
asked by 03.02.2018 / 00:28
1
answer

powershell: how to run an array in a query?

How can I change the word buin in my query to those in the array? $DB_NAME_M = "<A>(<B>)"; $TIMESTAMPP = Get-Date; $TIMESTAMPP = $TIMESTAMPP.ToString("yyyyMMdd"); #Arrays $DB_ARRAYY = @( "elquisco", "imelbosque", "macul", "larein...
asked by 15.01.2018 / 21:55