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 Articlehow 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 ArticleChanging file time
Is there a simple way to change date and time of a file with PowerShell - someting like "touch" in unix shell
View ArticleHow 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 Articlechecking 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 ArticlePowershell $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 ArticleGet-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 ArticleWhy 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 Articlereplace 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 ArticleHow 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 ArticleSwitching 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 ArticleHow 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 ArticleIssue 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 Articlereading 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 ArticleAltering 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 ArticleSyntax 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 ArticleHowto 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 ArticleWho 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 ArticlePowersShell 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 ArticleScript 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