File Explorer hangs when trying access Mounted Azure File share on Windows 10 Desktop - network-drive

I mounted a Azure File share on to my desktop trying test connectivity. Everything worked awesome until I deleted the Azure File share in Subscription.
After my test, I deleted the test file share from Azure subscription. Then I continued working on my desktop where the deleted Fileshare was still mounted.
I was trying to navigate to some folder in file explorer and it just hangs. I tried to end the task from Task Manager and Taskbar vanished for 1-2 hours. Then I force rebooted my desktop. It came back fine. Then I wanted to get rid (Unmap) of the mounted Fileshare and same thing repeats again.
Can someone please help me get rid Or UnMap a Network Drive the Azure Fileshare off of my Desktop? Any command or something to Unmap a Network Drive? I tried Net Use F: no luck.
I have a deliverable that need to work on now and finish before Moring but my desktop is unusable at the minute.

net use * /delete /y
saved the day for me. Now I can resume my work.

net use * /delete /y helps for me, but only when I kill explorer.exe process manually

In most cases after a couple of reboots net use ?? /delete /y command works, I have had issues in which I have had to take a more drastic approach in "refreshing windows profile".
Regards

Related

Task scheduler "Run whether user is logged on or not" issue to startup application

I have a .bat file that starts up a powershell script.
Within this powershell script, i startup PowerBI with a given database.
The powershell script waits till powerBI has been done starting up, and will then be exporting data to some datadump files.
Doing this manually works fine, and also when its on the task scheduler to run when user is logged on.
The moment i change this to "Run whether user is logged on or not" it doesnt work anymore.
The reason behind this, is that it seems that powershell is unable to start PowerBI and therefore there is no open data to query in the rest of the script.
So the positive side is it runs the bat and powershell just fine, only the powershell itself seems incapable to start powerBI.
Are there any solutions to this? should i for example use a different method to call the appliation to start?
currently the powershell snippit to start the app looks like this:
$PBIDesktop = "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"
$template = "C:\LiveData\Data.pbix"
$waitoPBD = 60
$app = START-PROCESS $PBIDesktop $template -PassThru
log_message "Waiting $($waitoPBD) seconds for PBI to launch"
Start-Sleep -s $waitoPBD
I faced similar issue. So, sharing my experience..
First of all, please verify couple of things.
Specify user account which will be used to invoke the job. Also, ensure that, the account have sufficient permission.
Don't forget to un-check the checkbox (as shown in screenshot) under Conditions Tab
Just found this one - sorry it took so long :D
But, i had this totally nervwrecking issue to.
Solution for me is to realize that the task scheduler is very deep part of the OS.
Thats why i have to grant access to the file, for the computername$ (system name) on the file or folder containing the file to run.
Rightclick on the file or folder -> Security. Select edit and add [Name of your computer]$ and give the read and execute permissions.
That's the only way I can make it run.
But i hope you found the solution in the meantime :)

Disconnecting OpenFiles

I've been researching and learning about windows batch files, PowerShell and cmd these past few days.
We're having issues with Open Files, so we manually go to the server and do it with a press of a button. But since there might be a possible way to automate it and do the script every 5 minutes.
Someone helped me already telling me that I should make a script of
openfiles /disconnect /a* /op "E:\SERVERNAME\"
& so I did and put it on the Windows Task Scheduler Action Tab - Start a Program and put the file path of the batch file that I made.
But It seems that it's not working and we're still having the same issue.
I hope I made it clear.

Startup Task not running on Azure Cloud Service role

I'm having difficulties trying to setup a startup task in an Azure role.
The ultimate goal is to disable RC4 cipher, along with other SSL configurations. In my (VS2012Express) project (solution partially achieved following another answer here in SO that led me to https://gist.github.com/sidshetye/29d6d48dfa0c2f5488a4 ) I created a Startup.cmd file like this:
# Execute powershell command to disable RC4 and imporve SSL security settings
ECHO Batch started >> "StartupLog.txt" 2>&1
PowerShell -ExecutionPolicy Unrestricted .\HardenSSL.ps1 >> log- HardenSSL.txt 2>&1
EXIT /B 0
HardenSSL.ps1 is the PowerShell script from the previous link. Both the .cmd and .ps1 scripts are placed in the application root directory, marked as "Content" with properties set to "CopyLocal=Always".
In my service definition, I put this:
<Startup>
<Task commandLine="Startup.cmd" executionContext="elevated" taskType="background"></Task>
</Startup>
Now, when I deploy the application to Azure, "nothing" happens. I configured the role instance to allow remote desktop, connected to the machine. I verified the scripts where published, and there were no log files, RC4 still enabled. I tried to manually run the .cmd and the machine runs the scripts to completion, disables RC4 and restarts. So the scripts are actually "correct".
The problem is that the scripts are not getting fired up at startup. I may be wrong, but I don't see anything related looking Windows events. Actually, the server now keeps all the configurations, but I have to be sure the scripts get executed in case I'll have to publish to new instances/cloud services.
I also tried to:
1. place the scripts on a child directory
2. create other 2 "simpler" .cmd that just create a log file with "script started" to exclude problems related to the .cmd calling the PowerShell script.
None of those scripts got executed.
Hope I've been sufficiently clear, any help would be greatly appreciated.
Thank you in advance,
Alberto
UPDATE 1
Reading through various discussions, I missed one very important thing: the script files are actually published in 2 distinct places, one being inside the /bin folder.
Ex: I placed my scripts in a /StartupScripts folder in my project, and when I connect via Remote Desktop to the Azure server I find the scripts both in "approot/StartupScripts" and in "approot/bin/StartupScripts".
The scripts the are actually executing are those placed inside the "bin" folder. the real problem is that I have probably a path problem inside the .cmd since I now found the execution logs with an error.
Now I will try to change it up and update the question here on SO.
Ok.
In the end it was indeed a problem with a path in my Startup.cmd file: .\HardenSSL.ps1 could not be found if the StartUp Task pointed to a subfolder.
Solution was to place both Startup.cmd and HardenSSL.ps1 files in the application root, remove the ".\" part when calling the PowerShell Script and all worked well.
Anyway, I would like to suggest anyone to pick this other solution I found in stack exchage:
https://security.stackexchange.com/a/79957
It links to a NuGet package that does the same thing as the script I found on the link to github in the original post, just "better"; mainly:
Better configuration of cipher suites, with support for ForwardSecrecy for all reference browsers on SSLLabs
Retain SSL support for Internet Explorer 8 on windows XP (unfortunately still a necessity for us)
Alberto.

XCopy works for a user but not for a service

I have TFS running an automated build. The solution runs a cmd file which runs out batch file and then performs and xcopy at the end to copy the results to our release PC.
If I run the cmd file manually the files copy over.
If I run it in the automated build then it fails with an Access denied cannot create directory error (the directory is there).
Is there an issue with sevices creating directories on other PCs or anything like that?
Sorted - the PC name needed to be added as a user on the remote machine in order to have access rights!

How to use Volume Shadows Copy and Robocopy on Win7?

I’d like to backup my system with Robocopy and Powersell but Robocopy is not able to copy opened files.
Volume Shadows Copy seems a solution but I don’t find any clear and simple explanation how to use it.
Do you have any idea?
I’m running on Windows 7 x64 Enterprise.
Thanks for your help.
Franck
In order to perform a VSS snapshot on Windows 7, you can simply do a "System Restore". After, open an administrator console, type vssadmin list shadows. You are looking for the "Shadow Copy Volume" line in the most recent snapshot. Copy this, and do mountvol X: YOUR_VSS_PATH, and your VSS snap will be mounted on X:. After that, run robocopy on X: and you should be good to go.
You can mount the VSS shadow using mklink command. This Works in Servers and Workstations.
mklink is a native tool.
For example:
mklink /D C:\shadow_volume_1 \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\
More information can be found here: http://forensicswiki.org/wiki/Mount_shadow_volumes_on_disk_images