Delete trash folder on a remote host

Hi community,
in a German forum a user is reporting an issue with odd behaviors between a Lion and a Snow Leopard client in a network. She said that if she deletes the trash folder in the Lion client, the trash folder in the Snow Leopard client become deleted too. Is there a feature in Lion that could cause this behavior? By the way, she noticed this issue as a side cross effect, primary she is searching for some mail issues. If she deletes a mail in one Client, the mail disappears in the other client also. I guess that this is a server setting problem but maybe this is associated with the trash folder issue. Any ideas?
Thx & Bye Tom

You're on the right track.  You can use Invoke-Command with the same credentials (or PSSession from New-PSSession, if you prefer) to execute code remotely.  The tricky thing, unfortunately, will be the credentials.  Right now you're being
prompted to enter a username and password, but in an unattended script, you'd need to have these credentials saved somehow.  That can open up a can of worms, depending on your requirements.
The simplest way to do this is to hard-code the password in your script.  No one on the planet recomments actually doing this, because well, you've just exposed an admin password to the world.
The safest way to do this is to log on as the same account that will be used to run the script, on the same computer where the script will be run, and enter the credentials once manually, and export them to an XML file.  With this approach, the credentials
in the XML file will be encrypted with the Windows Data Protection API (DPAPI), and the keys necessary to decrypt that data are only available to the current user, on the current computer.
If you need to be able to securely save the data and have it read by other users, or on other computers, things start to get more complicated.
Here's an example of the DPAPI approach:
# to create the credential file
$cred = Get-Credential
$cred | Export-Clixml -Path c:\myEncryptedCreds.xml
# to use it later (on the same computer, by the same user)
$cred = Import-Clixml -Path c:\myEncryptedCreds.xml
Invoke-Command -ComputerName SomeComputer -Credential $cred -ScriptBlock {
Do-Something

Similar Messages

  • Accidentally deleted trash folder

    Hello,
    I have searched everywhere trying to find a solution.  I had one folder on my desktop that had several subfolders inside of it.  I was deleting some desktop items and accidentally deleted this folder as well and then I emptied the trash folder.  I unfortunately never set time machine up on my iMac.  I also purchased a program to try to restore my files with no success.
    Does anybody have any suggestions?  I thought about trying to restore it to a prior time, but everywhere I am reading says that you need to have backed everything up with Time Machine.
    Any help would be greatly appreciated.

    If you deleted it then it's gone. Only thing would be if you had a backup then you could recover

  • Unable to delete file on the remote host

    Hi,
    I tried to delete a file on the remote host using File.delete method as well as using Runtime.getRuntime.exec("del filename")
    But both of them failed to work. First one returned false, but the second one is throwing IOException always.
    I am trying this through a java application in Windows NT environment. I am using jdk1.3. How can i solve this problem?.
    IOException occured at DataLoadFromTxtToOra exeBatchForTWS: CreateProcess: del \\ERSWEB\DTemp\ERS\HEB_428\DATAFILES\ERSWEB\DLCOMMA.txt error=2
    Regards,
    Babu

    you should be able to do that if you have rights on the file, try the following code and substitute the computer/share names:
                   File aFile = new File("\\\\COMPUTER\\share\\filename.ext");
                   System.out.println("Read: " + aFile.canRead());
                   System.out.println("Write: " + aFile.canWrite());
                   System.out.println("Exists: " + aFile.exists());
                   System.out.println("File: " + aFile.isFile());
                   aFile.delete();Mind the slashes: a single backslash is causing a escape character: \n for example is a (unix) return. A double \\ defeats it and results in a single \ in the filename
    If everything returns true I think the file will be deleted. If isFile() returns false you've got the path/filename wrong.

  • XML not working in remote host

    Dear colleagues, I've a JSP successfully running locally with J2SE1.4.2 and Tomcat5.
    The problem is it won't run when uploaded in the remote host. I've spent hours in vain, please help.
    The program should load an XML file located in the application folder (same path as the JSP), parse it into
    a DOM tree and retrieve some values.
    I'm getting NullPointerException.
    My import statements:
    <%@ page import="java.io.*" %>
    <%@ page import="org.w3c.dom.*" %>
    <%@ page import="org.xml.sax.*" %>
    <%@ page import="javax.xml.parsers.*" %>
    The code I'm using to get the real path of xml file from JSP scriptlet is:
    String filepath = application.getRealPath(filename);
    However, I also tried and failed with the hard-coded pathname like this:
    String filepath ="/var/tomcat/webapps/babyuniverse/myxmlfile.xml";
    Upon checking the Java version of remote host, I found that it is 1.2.2
    Now I guess, some of the packages I'm importing may not exist in the remote host, especially
    the org.w3c.dom and/or org.xml.sax.
    Upon checking the tomcat/lib folder in the remote host, I found it contains the following jar files:
    ant.jar; commons-fileupload-1.0.jar; jasper.jar; jaxp.jar; parser.jar; servlet.jar; webserver.jar
    Are those packages sufficient to handle my program. If not, which extra packages are needed and where
    they can be found? I've permission to upload files to tomcat/lib and also to restart tomcat if needed.
    But I cannot update classpath.
    Thank you for the help.

    Hi, I found out where to find those jars you mentioned.
    But unfortunately, I was wrong in stating that I'm allowed to upload files to
    tomcat/lib. When I tried, I couldn't. I could only upload them to
    my app's WEB-INF/lib. And this isn't working. Any ideas to solve my problem?
    I'm sure the line I'm getting the NullPointerException is at
    Document mydoc = myparser.parse(new File(xml_file_name));
    My assumption is that it is not able to find a parser.
    Please help someone.

  • Iphone e-mails can't be sent/transferred to trash folder? They are completely deleted.

    Just got new Verizon Iphone and use my business (IMap) & verizon (webmail) e-mail accounts. Whenever I delete an e-mail I get this message "could not move e-mail to trash folder" E-mails are just gone and I want them to go to trash incase I delete one by mistake? Thanks for your help in advance!!!

    Have you tried going into the email settings for each account, Advanced option, and  look at the mail box behaviors for each of the Drafts, Sent and Deleted mailbox?

  • IPhone 5 sending all "Sent Emails" to "Trash" Folder and deleted items not showing up at all

    My boss has an iPhone 5 and today she realized that trash folder only has the last 50 emails that she has sent.
    The trash folder is empty.
    We use gmail. Her outlook is fine and the web interface is fine. She's tried restarting her phone. Will we have to delete the account and resync? (please say no...)
    Thanks!

    Dear Mr. Rakesh Vijayan,
    What is your justification for below behavior?
    Using basic Gapps (free) email server,IMAP option client with MSO2013. Window 7 professional
    MO Professional Plus,
    (15.0.4535.1006), MSO(15.0.4535.1507)32-bit.
    Auto migrated/upgraded from MS2007 to MS2013 in March, 2013.
    Inbox repair tools has been run 03 times since last 6 months in safe mode..
    Already configured Settings> advanced and deselect "Do not save copies of sent items
    Already configured File > Account Setting > double-click your IMAP account and adjust "Mail to keep offline" to "All".
    Since March 2013, 95% mails are getting saved/appearing in Sent Items folder. Only some times few mails are not appearing in sent item outlook client folder.
    All those emails are also appearing in All mail Folders.
    Any email sent from Gapps web interface/browser definitely getting save/ appearing in sent item outlook client folder.
    But now since last 4 days no email sent using outlook are appearing in sent items folder.
    Sincerely Yours
    Kranti Mohan | Head-Corporate Sales, Mkt. & Development |
    GPS Address:30.725144N,76.765755E
    Maya Hotels|SCO 325-328 | Himalaya Marg | Sector-35B | Chandigarh-160022, India. 
    T: +91(0172) 4688774x (D)/4688700x174 | M: +91 (0) 9915707030 | F: +91 (0172) 2660555
    [email protected] |  http://www.mayahotels.in
    http://www.facebook.com/mayahotel |  http://www.youtube.com/user/mayahotels
    http://twitter.com/mayahotels  |  https://www.orkut.co.in/Main#Community?cmm=101119348

  • IPhone 5 can not delete emails. Will not move to trash folder or empty trash

    iPhone 5, I can get mai. I can send mail. I can not delete mail. If i click to send the read mail to trash folder... error ca not move mail to trash folder.
    I can move read mail to the trash folder, but can not empty the folder...
    HELP

    Read this thread https://discussions.apple.com/message/5616151#5616151

  • HT1222 try to delete emails after about 8 deletions of 37 they all come back even after i edit them from trash folder.

    hi this just started latley i started deleting messages from mail box would delete about 7/8 junk messages then they all come back,even tried deleting 4/5 then going into trash folder and edit all but they all come back to inbox any any answers? did soft reset no luck

    Do a Hard reset - Settings > General > Reset > Reset All Settings

  • I delete some emails ,there are moved to trash . I delete them from trash folder too and they still appear in a folder called 'all messages". I repeat the same actions and after a while they appear again!what should i do to delete them permanently??

    I delete some emails ,there are moved to trash . I delete them from trash folder too and they still appear in a folder called 'all messages". I repeat the same actions and after a while they appear again!what should i do to delete them permanently??

    If you are using Apple's Mail app 6.5 is the latest version irrespective of what a previous poster says. It does sound though that you are using a gmail account online via a web browser. Please confirm and fill in missing information.

  • TS4153 few files and folder are not deleting from trash folder

    i am trying to delete all files and folders from the trash folder by clicking  empty securely, but its not deleteing the files anf folder. please suggest how to clean the trash folder by deleteing all the deleted files and folder.

    Securely deleting items in Trash writes Zeros over the data so that it is completely eradicated.
    This will take quit a long time depending on how much data you have in Trash.
    Unless there is data that needs to be rendered unrecoverable in the Trash, you could choose to just delete the files and folders with out the secure option.
    Once you have Emptied the Trash unsecurely you can always use disk utility to Securely Erase Free Space on the Drive.

  • Cannot delete more than 4 e-mails from trash folder in one go

    When I try to delete more than 4 e-mails in one go from the trash folder on my Sony Xperia Z2, the e-mail software crashes with the message: 'Unfortunately, E-mail has stopped'. Is this a bug everyone is experiencing on the Z2?

    Thank you Thommo, your instructions have solved the problem. I cleared cache and data which got rid of the 4000+ e-mails in my bin folder. Then rebooted and inputted my e-mail account details. The e-mail app downloaded 157 e-mails from the TalkTalk server. I deleted them, and then deleted the same 157 e-mails from the bin folder... and it worked.
    Thanks for your help.

  • How do I mass delete email from Trash folder?

    Is there an easy way to mass delete the emails from the trash folder?

    In your settings>mail>account>advanced, there is a way you can set it to self delete after 1 day. This is the earliest setting to self delete the mails. If you need to delete all of them right away. Just open one of the mails and press the trash can icon at bottom. It automatically opens the next mail and you can just sit there thumbing the trash can until all are gone. Works for me, both ways.

  • Anyone know how to delete emails from trash folder?

    I have hada Droid phone for about 6 months.  When I delete emails from my inbox it goes to a "trash" file (similiar to trash file in Outlook).  It is getting full.  Any idea how to delete from trash folder.  My wife also bought the same phone but she does not have a trash file.  No one at our verizon store can answer my question as to how to delete from trash folder and don't seem to know how I have a trash folder on my email account.

    I'd go on the P.C. side of your Mail and start clearing it will clean what's on the phone and the Computer i have done this Many time on my Gmail and Yahoo.. b33

  • LG Ally - deleting pop3 emails from trash folder

    I have three pop3 email accounts set up on my LG Ally. All work great - however, deleting the all the emails in the trash folder is cumbersome. Is there a way to delete all the emails in the "trash folder" at one?  I can only seem to delete them by tapping each email individually and then tapping delete. This is a really slow process.
    Also, is there a way to adjust my pop3 email settings so that the trash folder is deleted automatically every so often?
    Thank you!

    There is not a delete all option to delete all the emails at once for  the default email application.   You also can not set a schedule to delete the trash folder.   There are other email applications with more customization options on the Android Market Place.  

  • How do I delete mail from trash folder

    I know how to delete the mail from my trash folder one email at a time. I have setting set to remove the trash folder every day, however, it isn't working. I have emails on that have been deleted 2 or 3, if not more days.
    Can someone tell me how to fix this, please? This deleting one email at a time from my trash folder is a bit of a pain.
    Thank you for the help!!!
    ryderdm

    You can delete all of the emails at once from the trash folder. Tap the edit button at the top, tap the red delete all button at the bottom and tap delet all again in the pop up.

Maybe you are looking for

  • How to print my report to pdf silently

    Hi , I have develop a program and that can print report to physical print automatically. Now I want to print them to pdf file automatically,  it prints about 1000 report a day. and the file name will be different each one, the filename will like :{re

  • Tethering Phone Recommendations - Please help!!!

    Hi all, This is my first post. I am in Afghanistan in an area that has Cell phone service that also provides GPRS internet. This is pretty much as good as it is going to get, but there are always possibilites that this internet system may be upgraded

  • Documents are not displaying

    Dear Experts, Some documents have been posted,but they are not being posted to the respective ledger and not even displaying in FB03.It is showing the documents do not exist. where as FBN1 suggests,the documents are being captured.What could be the r

  • Issue in query designing

    Hi all, We have a requirement where in we need to get the variance of last 2 quarters.We have Quarter(manual entry),Current Fiscal Year and Fiscal Year/Period time characteristics. If the current Quarter is 1 and fiscal year is 2009 - then it is easy

  • Error when exp clob file

    EXP-00056: ORACLE error 3120 encountered ORA-03120: two-task conversion routine: integer overflow