Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

Debugging Powershell in Visual Studio 2017 RC

Hi,I can't seem to run or debug powershell scripts in VS 2017 RC. Is this a known issue or did I not set something up properly?Thanks!

View Article


how to schedule server reboot task on multiple servers

There are more than 1000 servers in the environment that needs to be rebooted on weekly basis.need assistant to Remotely schedule a "server reboot task" on every Saturday at 12:00 am.

View Article


Changing file time

Is there a simple way to change date and time of a file with PowerShell - someting like "touch" in unix shell

View Article

How to remove spaces/white spaces in Environment variables.

Hi..I have requirement in which to remove the spaces with the short file name from the Environment VariablesBelow is my code..but it is throwing an error..please suggest.$fso = New-Object -comobject...

View Article

checking the Condition continuously whether the service is stopped or not

I have a service which takes around 30seconds to stop and start respectively. I used below code to take a pause to complete the execution of stopping the service, otherwise$x =...

View Article


Powershell $webclient.UploadFile

Hello Community!I am new to powershell and i have been playing around with getting files to upload using FTP.I have got it working and i am happy with the results but i would like to get the script to...

View Article

Get-ADComputer : Could not load type...

Hi All,I have a problem in running script, which gives details of all machines in AD when ever I try to run this particular script I am getting below error..Get-AD Computer : Could not load type...

View Article

Why can I set ownership with icals but not with set-acl On 2K12R2?

Why using get-acl -Path 'C:\Program Files' | set-acl -Path 'D:\Program Files' as an administrator tells me I am not allowed to set the ownership while using icACLs"C:\Program Files" /save Perms.txt...

View Article


replace operation in filename extension

In order to move files from one application to another I need to change extensions from the format .0123 to .123.  Throwing away the leading character is not a problem.  My newbie attempts with...

View Article


How to remove string entries from host file without adding new line

I want to delete a line from host file upon matching the string and i am using below code..however it keeps adding new line and because of that new contents appear in middle of the host file.Kindly...

View Article

Switching Between different networks- LAN , WIFI & 3G

Hi All , We are going to use tablets for some job functions to enable mobility and some additional functions. Tablets will be connected to LAN at office through a docking station and users  should be...

View Article

How to create a MOF file where admin can only query it

Hi,         I have created a MOF file and registered the MOF in repository with mofcomp.exe. Now i can able to access the MOF from Powershell ISE using WMIC command. Can any one please let me know, how...

View Article

Issue with Pasting to Command Line/PowerShell

Hi,We are unable to paste text from an application other than Command Prompt (CP) or Windows PowerShell (PS) to CP or PS.The issue is only occurring on one of several Windows Server 2008 VMs.The server...

View Article


reading a variable for a certain word

I have a function that when run will return information letting you know if your target system needs to be rebooted. The output if this function looks like this:Computer           : PCName1CBServicing...

View Article

Altering cluster share permissions - Error status 2310 (this shared resource...

Hi everyone,I'm desperately after some assistance with a Powershell script. Following the necessity to implement anti-ransomware measures, we now have a script designed to set all share permissions to...

View Article


Syntax for a PowerShell

Hi All,I am in need of a PowerShell command that does the equivalent to the below RoboCopy command:robocopy \\fileserverX\folderA \\destinationserver\folder1\folder2 /E /ZB /DCOPY:T ?COPYALL /R:1 /V...

View Article

Howto force a function to return a specific datatype?

I'm trying to create a powershell module with a function coded to return a "System.Data.DataTable".  However, the resulting datatype type from the calling program's perspective is an array if multiple...

View Article


Who will be crowned the last PowerShell Guru of 2016!!

Calling all wise men! And all the Wise Ladies!Join us and rejoice!THE FINAL CHALLENGE OF 2016!!December 2016 Guru, it’s time to share great skills as a TechNet Wiki article and WIN medal(s). Medals?...

View Article

PowersShell system.data.SQLClient.SQLAdapter not honoring...

I have a simple power Shell Script that I am using to test ApplicationIntent=Readonly Routing $Query="Select @@Servername"$con="Server=AGListnerName;database=DBName; User...

View Article

Script changes config on many servers. Needs Successful/Failed output per...

We are going to change IP address for Preferred DNS server on many machines. We have a script that works. It uses a list of servers in a text file and executes accordingly.But we need an output that...

View Article
Browsing all 21975 articles
Browse latest View live