0
votes
2answers
37 views

Exception calling “UploadFile” with “2” argument(s): “The Content-Type header cannot be set to a multipart type for this request.” [duplicate]

I am working with a script that is supposed to first check if a PC is alive then FTP a file to a server. However, when running the script I am getting the following error: Exception calling ...
1
vote
1answer
126 views

Looking for a powershell script that can pull a file from a set of PC's and FTP

I'm looking to write a script (preferably powershell) that will essentially copy a file from a bunch of PC's and FTP it to a server. So the structure of the environment is that we have a file on ...
-2
votes
1answer
55 views

powershell script that outputs date of the day as a file name

I have a script which lists local admins of all hosts in Active Directory below: $Searcher = New-Object DirectoryServices.DirectorySearcher([ADSI]"") $Searcher.Filter = "(objectClass=computer)" ...
0
votes
1answer
40 views

Automate app pool recycling of an Azure Cloud Service Web Role

How can I script (e.g. using PowerShell) the action to recycle the app pool of a web site hosted in a Web Role on Azure Cloud Services? Only one instance of the cloud service is running (used for ...
1
vote
2answers
54 views

AD Group and Distribution Group with O365

I have a O365 with Exchange, and a local AD. I want to manage distribution groups and distribution groups members via PS scripts (that will run by scheduled task), that look users' AD attributes ...
0
votes
2answers
112 views

Copy-item FileSystem provider error

Copy-item cmdlet is not working as expected, i don't understand why. This is my code : $Source = "C:\folder1" $Destination = "\\172.22.0.115\c$\folder2\" $Password = ConvertTo-SecureString ...
0
votes
0answers
45 views

Powershell deploment script into multiple 2003 windows servers

I have created a script "test.ps1" that runs security checks on folders within machines. Now I want to deploy this script into 70 windows servers so it can run these security checks on all of them. ...
-1
votes
3answers
352 views

How to change default install path for Notepad++ in Powershell silent/unattended script

I cant figure out the parameter(s) to change the default install path C:\Program Files\ of Notepad++ to the drive I want it to install to when I run my PowerShell script. I am trying to do a silent ...
1
vote
1answer
334 views

Comparing 2 CSV files in powershell exporting difference to another file

I've write this script out, and could have swore I had it giving me a Failed early this morning but now I'm getting nothing and not sure why. Basically I need to compare $SourceAddress with ...
0
votes
1answer
74 views

Powershell pipe exporting to csv is loosing data

I'm trying to write a script that will take input from a .txt file of IP address. Do a reverse DNS lookup to get the hostname of the IP address and then export that data into .csv file. Here is what ...
1
vote
2answers
32 views

Debugging powershell init

My problem is that I just reinstalled my system and have installed heaps of packages via Chocolatey. However now when I launch powershell, something changes the fonst type and size inside the console ...
2
votes
2answers
1k views

Powershell: Single Script to “clean” multiple folders of files older than

I would like to create a maintenance script that would run on each of our servers to clean out common drop/archive directories. Preferably the script would use a reference file for the folder path ...
4
votes
2answers
102 views

OK to modify HKLM\Software\Policies and HKCU\SOFTWARE\Policies on a domain?

Background: I have a domain (2003 Functional Level) with a mix of Windows XP and Windows 7 clients. We have been using Group Policy to manage our workstations. Now, I am in a situation I need to ...
3
votes
1answer
117 views

Change shortcut arguments via script

We have a program here that requires every user to have a shortcut on their desktop that points to an ini file. Each file is unique to the user. Recently, we've done a new install of the application ...
3
votes
2answers
738 views

Remove all recurring meetings scheduled by terminated user

I am looking for a way to efficiently and effectively remove all meetings that a terminated user may have created during their tenure. Currently, our group has to grant admin access to the user's ...
-1
votes
1answer
46 views

How to loop specific powershell script

I need to uninstall Java from several computers in my network. After almost all day of Googling it seems the best way to do this is with a Powershell script. I found one that I have tested on a few ...
0
votes
0answers
227 views

Packet drop monitoring on vmnic objects

I'm trying to create a script via PowerCLI that can monitor packet drops for vmnic objects. I was able to find online a version of the script that does exactly what I want for host servers, however ...
1
vote
2answers
157 views

powershell script to create exchange report

I have some script write on PowerShell and I have some problem. When I run this script I have some error in output: You cannot call a method on a null-valued expression. At ...
2
votes
1answer
268 views

Powershell - Select-object keeping same columns throughout script

OK. I'm just drawing a blank here or I'm missing something obvious. In a Powershell (V3) script, I'm calling Get-ADUser -Filter 'SAMAccoutnName -like $ADUserName' -Properties ...
1
vote
1answer
88 views

Schedule Task 2008 R2 - cmd line requires unix utc time - how to get it dynamically?

These forums are great, and I'm hoping to get some help with a headache I have on doing a process manually that should be easier to automate than I've found it to be. I have a command line tool from ...
2
votes
3answers
1k views

Add user account to local Administrator group on multiple Windows Server 2008 machines

I have a number of servers to which I need to grant administrative access to 1 particular user, i.e. add him to local admins. I guess it can be scripted with PowerShell or somehow else.. Can somebody ...
4
votes
1answer
762 views

Assign Static MAC address to VM Hyperv

I have a scenario that involves building out a ton of virtual machines in Hyper-V, I cannot use SCVMM and must use a scripted method to create these VMs. I have a CSV with all required information ...
0
votes
1answer
1k views

Using Powershell to Create Exchange Contacts from a .CSV file

What I would like to do is use a Powershell script to create Contacts within a certain folder in Active Directory from a .csv file. This script should allow me to create the first part of an email ...
1
vote
1answer
168 views

Scripting WINS Tombstone Removal

I'm creating a script to remove the tombstoned entries in WINS (required for exchange w/ multi domains). What I'd like to know is if removing those old entries will break anything? Or if there's ...
4
votes
2answers
379 views

How to get from a Hyper-V 2008 R2 node with Powershell the IP address and Vlan ID

I tried to take from the Hyper-V (Hyper-V 2012) node with this command the IP address: Get-VM | select -ExpandProperty networkadapters | select vmname, ipaddress The thing is that i take as an ...
-1
votes
1answer
128 views

portqry to check connectivity

Is it possible to check the connectivity between 2 remote servers using portqry given that the portqry.exe command is executed on another server. for example, check the connectivity between serverA ...
4
votes
5answers
1k views

Powershell script to delete oldest files (not relative to current date)

I DO NOT want to "delete files older than X days." If I wanted to do this, I'd just pick one of the thousands of scripts out there that have already been written for that purpose, and I wouldn't ...
12
votes
2answers
277 views

What is the industry standard method for administering the change of the local administrator password for all machines on a domain?

Although there appears to be three available options, one of which is actually secure, there seems to be only two available choices that will be able to impact machines that are not powered on at the ...
-2
votes
1answer
541 views

Script to copy down portions of a roaming profile [closed]

I'm currently working on migrating users to Windows 7 from XP. We use roaming profiles. Xp creates a folder named "Profile", while Windows creates "Profile.V2". Theses folders are independent of each ...
1
vote
0answers
582 views

Powershell Script Hard drive Inventory

I've created a script to get hard drive information from our servers. The script use WMI to query the Win32_LogicalDisk class and returns "Size (GB)", "Free Space (GB)" and "Free Space (%)" for each ...
4
votes
1answer
528 views

How to get Mailbox Folder Permissions with SamAccountName or UPN?

I need to collect and store the folder permissions for each folder in each mailbox of our Exchange system. I'm already aware of the Cmdlet Get-MailboxFolderPermission but it has a serious problem. ...
4
votes
2answers
920 views

Changing physical path on IIS through appcmd isn't activated

We have come across an issue on IIS 7.5 where we have a simple deploy system which consists of the following: Create a zip-file of new webroot, consisting of three folders: Api Site Manager This ...
0
votes
1answer
152 views

Hyper-V and Windows Server with Powershell/Automated?

So my work is looking into Automating Hyper-V Servers for Test Environments, Basically in the end we want to have a sort of Web/Form interface for selecting a server spin up. Right now it's done ...
2
votes
1answer
75 views

How Can I Source My $Profile From A Powershell Function?

I like to make a lot of changes to my $profile file. After saving a change, I would like to source the file using an "sop" alias. Here's how I hope to accomplish that: set-alias sop Source-Profile ...
0
votes
1answer
488 views

Powershell script to insert SQL Statement with a apostrophe error

I have the following part of a script that takes objects form Exchange and AD and inserts into a MYSQL table. But some of the Full Names variables have a ' like the distribution group PA's. Here's ...
1
vote
2answers
334 views

How do I write a powershell script to install RDS-RD-Server role?

I assumed I would just put the following in a filename.ps1 named file and run it like: powershell.exe -noexit 'filename.ps1' It runs, but it's not doing anything. Inside the filename.ps1 I have ...
0
votes
2answers
387 views

Powershell changing Date to the first of last month when the script runs [duplicate]

If I run the script on 2/4/2013or any other day in February I want the date to be change to 1/1/2013. I am replacing date on line 59 with this value. #Get the content of the CMS Script. $CMSReport = ...
1
vote
1answer
1k views

replacing a line or date in a text file using powershell

I am trying insert today's date on a text file at line 59. How do i do this? Line 59 has like 30 spaces and then reads like this. After the PowerShell script runs it will change the date so it has to ...
0
votes
1answer
690 views

Export hardware specifications to a spreadsheet for Windows Server

I have a bunch of servers : Windows 2003 and 2008. I just wanted to export these hardware specs to a spreadsheet: cpus : num processors, clock speed, etc total hard disk space total used disk space ...
2
votes
1answer
751 views

Powershell VMWare Script not running from Scheduled Task

Background / Goal I am attempting to create a scheduled task that will: Run at the specified time (once) Run a PowerShell script that: Logs all of its output as a transcript Connects to my vCenter ...
0
votes
1answer
255 views

powershell script to move backup files

I want to zip sql bakup files and move from one directory to to another directory within a system using powershell 1.0 can you help me since am a beginner
0
votes
1answer
205 views

Powershell error when adding filepath

The script looks like this: $searchOU='ou=Servers,dc=mydomain,dc=NET' Get-ADComputer -filter * -SearchBase $searchOU | Foreach-Object { $server = $_.Name ...
2
votes
1answer
659 views

Mirror directory, only purging files in destination directory older than 7 days

I would like to mirror a directory, but only delete files in the destination directory older than 7 days. Situation: - Directory A is mirrored to Directory B. - A file from Directory A is deleted ...
3
votes
1answer
443 views

How can I automatically delete /tmp folder on shared drive?

We have a /tmp folder that people use for temporary stuff. It can be anything and any file. We want to make it so that this automatically deletes (or preferably MOVES to another folder on the same ...
8
votes
2answers
577 views

Using Diskpart in a PowerShell script won't allow script to reuse drive letter

I built a script that mounts (attach) a VHD using Diskpart, cleans out some system files and then unmounts (detach) it. It uses a foreach loop and is suppose to clean multiple VHD using the same ...
3
votes
1answer
302 views

Powershell script for setting password expiry

Due to mistakes by the helpdesk staff, I found that over a 100 user accounts in my company AD have been set so that their passwords never expire. To avoid the situation in which all these users ...
1
vote
1answer
69 views

Remove content of file but not the file itself with windows scripting

How do I strip the content of a file without removing the file itself in a windows scripting environment?
0
votes
1answer
265 views

IIS script privileges with powershell

I've created a script for most of the functions I need when creating a Site for my IIS, however, there is still one thing missing. Namely, I can't seem to find the commands for setting script ...
1
vote
2answers
939 views

Delete Computer Object in AD with Powershell?

I am able to use the native add-computer cmdlet to join a computer to a domain, but it seems that this cmdlet fails if the systems already exists in AD, and you are trying to add it to a different ...
0
votes
1answer
1k views

How can I run an elevated powershell script as part of VMWare Customization Specification?

Background / Goal I have a VMWare template that I am deploying and I am using VMWare's "customization specifications" to perform many of the sysprep tasks. The last thing I need to accomplish is ...