Find and deleted the file with powershell.

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 12 years and 1 day old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
deliyurek007
Posts: 4
Last visit: Mon Mar 26, 2012 5:27 am

Find and deleted the file with powershell.

Post by deliyurek007 »

Hi,

I just forget to tell about the fist post when I just change the legacyExchangeDN and msExchHomeServerName I must delete all the file like on the user directory to create a outlook profile. I must do a search on users directory and must delete the following file like *.nk2 and *.once extension files.

The user is on file user share like: FSuserUsers*.* with all the user directory's.

How can I write also a powershell command for that to do a search on that specified user share directory and delete automatic the files for me.
Is this possible to do that with powershell.

Kind regards,
Deliyurek007
User avatar
deliyurek007
Posts: 4
Last visit: Mon Mar 26, 2012 5:27 am

Find and deleted the file with powershell.

Post by deliyurek007 »

The file like *.nk2 in the folder is hidden normally.
it is a powerfuse menu like pwrmenu folder on the user directory. Example: FSuserUsersTestUserpwrmenu

Kind regards,
Deliyurek007
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Find and deleted the file with powershell.

Post by jvierra »

help remove-item -full
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Find and deleted the file with powershell.

Post by jvierra »

I have no idea what you are talking about.

You are trying to reinvent the wheel. Just delete teh profile reference in teh registry and Outlook will prompt for a new connection.

Without an installer you will not be able to reconnect Outlook. It is an encrypted setting in the registry.

jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Find and deleted the file with powershell.

Post by jvierra »

The nk2 file is here:
dir pcnamec$UsersjvierraAppDataRoamingMicrosoftOutlook*.nk2

If the profile is not roamed it will be in AppDatalocal

The files are not hidden.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Find and deleted the file with powershell.

Post by jvierra »

dir FSuserUsers* -recurse -include *.once
This topic is 12 years and 1 day old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked