Using PowerShell 1.0 copy-item GroupPolicy Folder(C:\WINDOWS\system32\GroupPolicy)
Hello everybody,
This is my first time posting in this forum and i have encounted an issue i hope you can help i'm trying to create a powershell 1.0 script as this is for Windows XP to copy default policy back to their original folder then do a gpupdate on the copmuter so
that the Local policy are returned to their default but i'm having access denied as this is user account and needed a way to make it run as an administrator but without success as i'm new powershell.
Copy-Item 'C:\WINDOWS\system32\GroupPolicy\Original Group Policy for User and Machine\Machine\*' 'C:\WINDOWS\system32\GroupPolicy\Machine\'
Copy-Item 'C:\WINDOWS\system32\GroupPolicy\Original Group Policy for User and Machine\User\*' 'C:\WINDOWS\system32\GroupPolicy\User\'
Your help is much appreciated.
Hi mniceguy81,
Did you try to enable "run as" in XP ?
Please refer to following link :
http://support.microsoft.com/kb/294676
And please try to use powershell command :
$cred = New-Object Management.Automation.PSCredential("$UserName", $securePassword)
copy-item xxxx xxxx -credential $cred
Best Regards
Elton Ji
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place.
Similar Messages
-
HT204384 how do i copy items in folder to sd card
how do I copy folder onto sd card
am new to my mac
thanks angeloAssuming your SD card is large enough you can right click, copy and then right click on the SD and paste.
-
ARD: destination items from the "copy items" window
How can I delete or modify the list of last used destinations from the "copy items" window?
Thanks in advance,
MikeHi,
This issue may occur if there is a corruption of either the rule or within the mailbox.
Please first try to reset the send/receive settings to check the result. Resetting the send/receive settings can be achieved by renaming the srs-file of your profile to .old. You can find the srs-file for your mail profile in:
C:\Users\%username%\AppData\Roaming\Microsoft\Outlook
If above doesn't fix the issue, please go to File > Manage Rule & Alerts, delete the rule and then run a repair of your Outlook data file. Then, recreate the rule to check the result. For detailed steps, please refer:
http://www.msoutlook.info/question/133
Please let me know the result.
Regards,
Steve Fan
Forum Support
Come back and mark the replies as answers if they help and unmark them if they provide no help.
If you have any feedback on our support, please click
here -
Can not create a file under \window\system32 folder
How do I create a folder in \windows\system32 in x64 machine through java code?
Creating a file/folder under \windows\system32 fails and java creates a folder in \windows\syswow64 folder.
pls see the code attached for example.
My client wants to create a folder using my application.
I dont want to use any native code suggested by microsoft. You can see in the following link
http://msdn2.microsoft.com/en-us/library/aa365743(VS.85).aspx
import java.io.*;
public class FileTest{
FileTest(){
boolean created = writeFile();
if (created)
System.out.println("File Created Successfully");
else
System.out.println("Could not able to create the file");
public static void main (String args[]){
FileTest ft = new FileTest();
public boolean writeFile(){
try{
Writer output = null;
String text = "Sample Test File";
if(!(new File("c:\\windows\\system32\\customFIle").exists())){
new File("c:\\windows\\system32\\customFIle").mkdirs();
File file = new File("c:\\windows\\system32\\customFIle\\write.txt");
output = new BufferedWriter(new FileWriter(file));
output.write(text);
output.close();
return true;
}catch(IOException ioex){
System.out.println(ioex);
return false;
Thanks in advancejava_mani wrote:
How do I create a folder in \windows\system32 in x64 machine through java code?Can the user that executes this Java code create "manually" a folder in that directory?
Creating a file/folder under \windows\system32 fails and java creates a folder in \windows\syswow64 folder.
pls see the code attached for example.
My client wants to create a folder using my application.
I dont want to use any native code suggested by microsoft. You can see in the following link
http://msdn2.microsoft.com/en-us/library/aa365743(VS.85).aspx
Why not? -
Copy-Item using Windows PowerShell Multithreading?
Hello all,
I need to figure out a way to copy a 500MB .zip file to about 400 servers in parallel.
Until now, I have been using the ForEach () method. But, I'd like to use a parallel method so that I can copy 500MB to multiple servers at once, to lower the total copy time.
I have been reading that I can do this using PowerShell Jobs. What is the best way to do this?
Here is my code using ForEach:
$servers = Get-Content C:\servers.txt
ForEach ($server in $servers)
Copy-Item -Path C:\500MB.zip -Destination "\\$server\c$\" -Verbose
Any help very much appreciated.Hi Tommymaynard,
Sorry for reopening this thread. I'm facing a same scenario as that of TechNetKing. I want to do a copy from my local machine to 'n' remote machines.
I tried the following:
$remoteMachines ='MachineA', 'MachineB', 'MachineC'
Invoke-Command -ComputerName $remoteMachines -ScriptBlock {
Copy-Item -Path "\\MachineZ\C$\Sample.txt" -Destination "\\$_\C$\" -Verbose
MachineZ is the machine from which I'm running the above script.
Access is denied
+ CategoryInfo : PermissionDenied: (\\x.x.x.x\..Sample.txt:String) [Copy-Item], UnauthorizedAccessException
+ FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.CopyItemCommand
+ PSComputerName : MachineA
Cannot find path '\\192.168.172.219\Public\Aravind\invoke-parallel.txt' because it does not exist.
+ CategoryInfo : ObjectNotFound: (\\x.x.x.x\...Sample.txt:String) [Copy-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
+ PSComputerName : MachineA
(Same error message repeated for MachineB and C as well)
Am I doing it right ? PLease help.
Thanks in advance,
Aravind -
Using Copy-Item to overwrite files in remote server directory
Hello,
I am trying to copy newer files over older files from my workstation to a server using the copy-item cmdlet.
The cmdlet looks something like this:
copy-item *.* \\servername\c:$\pathname -force
There are no subfolders involved, so -recurse is not necessary.
When I run the command, I get this:
Copy-Item : Access to the path <Destination> is denied.
At line:1 char:1
+ Copy-Item '<source file>' '<Destination>
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Copy-Item], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.CopyItemCommand
I am running with administrative credentials at both ends of the network path AND I can use the GUI to copy and paste the files using Windows Explorer. I am losing hair due to scratching my head.Yes, what threw me was my ablity to copy and paste using Explorer from my machine to the server in an RDP session. I asked myself, "If I could do that, why can I not use the command line?"
Then I did some googling and found all kinds of the same error but it was pointing towards files that existed or sharepoint sites. In some of those cases, the solution was to remove the folder and then replace it. That was not a an option in
my case.
So, I figure I can read using my normal user credentials and copy to the clipboard and then in the RDP window, I am the Admin user and can paste from my machine's clipboard. Interesting behavior. -
Why I cant view my picture on my iphoto and if I try to copy to any folder it Shows "The item on the clipboard cant be pasted to this location. (One or more of the item may have been deleted or are no longer available) "
There are 9 different versions of iPhoto and they run on 9 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS. So to get help you need to give as much information as you can. Include things like:
- What version of iPhoto.
- What version of the Operating System.
- Details. Describe the problem as fully as you can. For example, if you have a problem with exporting, then explain by describing how you are trying to export, and so on.
- History: Is this going on long? Has anything been installed or deleted? - Are there error messages?
- What steps have you tried already to solve the issue.
- Anything unusual about your set up? Or how you use iPhoto?
Anything else you can think of that might help someone understand the problem you have. -
Best way to Create Shared Folder using Powershell
Hi
Does anyone have any recommendations on creating a shared folder using PowerShell? I've used new-item to create a folder, is there a way to share it and give specific name?
CheersHi Shane,
I’m writing to just check in to see if the suggestions
were helpful. If you need further help, please feel free to reply this post directly so we will be notified to follow it up.
If you have any feedback on our support, please click here.
Best Regards
Anna
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
Copy file from local system to Azure VM using powershell
Hi
Is there a simple powershell command to copy a small file from local computer to Azure VM. Point to Site is not an option for me.
I am hoping for something simple like
Copy-Item C:\Wabash\Logfiles\trasfer.txt -Destination C:\Presentation -ConnectionUri $uri -Credential $credential
similar to Invoke-Command
The only other option i have seen is
http://www.mattwrock.com/blog/copy-files-from-local-computer-to-an-azure-vm
which i fell for my purpose is over kill.Hi,
I will mark Ed's post as answer, if you fount that doesn't give you help, please feel free unmark it and follow up with more information.
Best Regards,
Jambor
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How can I assign an icon to a folder using Powershell?
How can I assign an icon to a folder using Powershell?
I'm trying to make a script that goes through a folder recursively, checks for every folder if it's name is "template", and if so it changes the icon of that folder to an icon
I chose.
I searched for an answer here, and I've only managed to find a way to assign an icon to a shortcut, but not to an existing file.
Thanks in advance (: -
Using a text file to provide paths for copy-item
OK, please don't beat me over the head too much for this. I've been trying various methods all day and nothing seems to be working. I have a text file that has a list of folders (full paths including drive letters). I want to copy all of
the folders and their contents to another path. The destination path does not change (d:\temp\destination) but each of the folders in the text file should end up being subfolders of the destination
Sources:
d:\source1 (has file01.txt, file02.txt)
d:\source2 (has file03.txt, file04.txt)
Destination
d:\temp\destination
Should end up with something like
d:\temp\destination\source1\file01.txt
d:\temp\destination\source1\file02.txt
d:\temp\destination\source2\file03.txt
d:\temp\destination\source2\file04.txt
I've tried
Copy-Item -Path D:\Temp\paths.txt -Destination D:\Temp\attachments -recurse -Force
which just copies the file that contains my paths.
I've tried
foreach($line in (Get-Content -Path D:\Temp\paths.txt)){$dest_folder="D:\Temp\destination" | Copy-Item -path $line -destination $dest_folder -force -recurse}
I get an error that says
Copy-Item : The input object cannot be bound to any parameters for the command either because the command does not take
pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
Would anyone mind helping me out here? If I need to create a file that has the source foldername as well as the destination path, I can do that, I just figured there has to be a way to specify a base directory and let powershell do its thing from there.try
$SourcesFile = ".\sources.txt"
$Root = "d:\temp\destination"
foreach ($Source in (Get-Content -Path $SourcesFile)) {
$Destination = Join-Path -Path $Root -ChildPath (Split-Path -Path $Source -Leaf)
Copy-Item -Path $Source -Destination $Destination -Recurse -Force
Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx -
What 'item type' do I use to add action to SCHEDULER CHAIN folder?
I am using SQL Developer version 3.1.06.82
I would like to add a User Defined Extension to a Scheduler CHAIN. I am looking through the Namespace for Version 3.1 at: http://www.oracle.com/webfolder/technetwork/sqldeveloper/3_1/dialogs/index.html. Under the COMMON OBJECT TYPES, I do not see any of the Scheduler items. I was able to use <item type="SCHEDULER"> to add an action to the SCHEDULER folder, but what I really want to do is add an action to a CHAIN.
Does anyone know what type name to use??
Has the Namespace been updated and published somewhere else?
If you have an example, it would be greatly appreciated.
Edited by: 975201 on Feb 28, 2013 8:24 PM>
I would like to add a User Defined Extension to a Scheduler CHAIN. I am looking through the Namespace for Version 3.1 at: http://www.oracle.com/webfolder/technetwork/sqldeveloper/3_1/dialogs/index.html. Under the COMMON OBJECT TYPES, I do not see any of the Scheduler items. I was able to use <item type="SCHEDULER"> to add an action to the SCHEDULER folder, but what I really want to do is add an action to a CHAIN.
>
Those COMMON OBJECT TYPES are database schema objects so SCHEDULER or CHAIN would not be in those lists.
Did you try "CHAIN" or "SCHEDULER CHAIN"?
I suggest you change your thread subject to match your question and maybe one of the developer team members will notice it.
For example: What 'item type' do I use to add action to SCHEDULER CHAIN folder? -
GPO Folder redirection using Powershell
Dear,
how can i configure a gpo for Folder Redirection using powershell.
I would like to create gpo's with all kinds of folder redirection configurations using a script.
DavyHi,
Just checking in to see if the suggestions were helpful. Please let us know if you would like further assistance.
TechNet Subscriber Support
If you are
TechNet Subscription
user and have any feedback on our support quality, please send your feedback
here.
Regards, Yan Li -
I copied my iTunes folder to an external HD and now I cannot delete it. When I try to move it to the trash it displays: The item “iTunes” can’t be moved to the Trash because it can’t be deleted.
Close iTunes. Click the icon to start it, then press and hold down the left shift key. Keep holding until asked to choose or create a library. Choose the iTunes folder on your external drive. That should bring back all your playlists, ratings, play counts etc. You may have to settle for removing and reloading the media onto the device again. That's not too bad, but what you don't want to have happen is your apps being removed and reloaded as then you can lose settings and data. If that looks likely backup and then restore the device rather than sync it.
If for some reason rebuilding the library the way you did has moved files around then the restored library may have trouble finding things. If so post back and I'll explain what to do...
tt2 -
Using "PARAMETER.param_name as a "Copy item from value" reference
I a, using forms 9i and I am having a problem using a Parameter as a reference item. The parameter item is there and I am spelling it correctly, i have even cut and pasted the parameter name into the Copy item value. No matter what I do I get the same result.
FRM-30047: Cannot resolve item reference PARAMETER.PROJECT_UID.
Item: PROJECT_UID
Block: GRANT_SUMMARY
Form: GRANTS
FRM-30085: Unable to adjust form for output.
I have even added a colon to the word PARAMETER but this too fails.
Suggestions pleaseYou have to assign it programatically as 'Copy item from Value' is mainly there to keep the master detail relationships. It actually expects a block item rather than a parameter.
Antony.
Maybe you are looking for
-
Persistent Flashing Question Mark Folder Icon, after Repair & Rebuild-THX!
Hello All, Thank you in advance for any insights. For the past week, one/two days after a force re-boot, my Quicksilver Mac (OSX 10.4.11 and OS 9 Classic) starts up with the dreaded flashing question mark folder. The start up disk has always been on
-
Detail table refreshing without partial trigger!!!
Hi, my Jdeveloper version is 11.1.2.3.0 I have a master detail structure on my page and i have two weird behaviors (that i guess are related). I created the master detail tables in the classic way: I dragged the master data control and doped it on th
-
SAp Solution for revised IAS 23 - Borrowing Costs
Does SAP has any solution to adopt/adhere to the revised IAS 23 which requries to capitalize the borrowing costs.This is effective from 01.01.2009. I can devide the required activities into below. 1. Determine borrowing cost u2013 Specific borrowings
-
How to run program in background?
Hi Experts. Please tell me wht is the procedure for scheduling a Job in background? I need all steps thanks in advance
-
Anyone having issues transfering rentals to 80gb classic? Already updated to latest software version 1.2.3.