thub.users.profile.tabs.comments.personalized


Thank you for your reply

Yeah I also want to achieve via PowerShell

We can compare file hash

For example

Variables

$fileA = "C:\Users\Public\Desktop\pdf.pdf"
$fileB = "\\shared\ABC.pdf"




if(Test-Path 'C:\Users\Public\Desktop\ABC.pdf')){
write-output: "File exists "



}
{ Copy-Item ....
}


if((Get-FileHash $fileA).hash -ne (Get-FileHash $fileB).hash)
Remove-Item .....
Copy-Item ......

{

}


My logic

Situation 1 If file ABC.pdf not exist on public desktop copy file from shared folder
write-output :"File has been copied"
Situation 2 If file ABC.pdf exist on public desktop we should compare file hash
if file hash is different we should delete ABC.pdf and copy file from shared folder
write-output :"File has been updated"
else write-output : Files are the same






How can I run the PowerShell because there are two if conditions?

Match also works
As I mentioned if I use like

(asterisk) Google (asterisk) I don't why the sign asterisk can't show here it worked for me

if((Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Google\Chrome").ManagedBookmarks -like
’[{"topleve_name":"Bookmarks"},{"url":"https://www.google.com","name":"Google"}]‘){
Write-out $true
}else
{
Write-Output $false
}

For example because in the scripts include {[ I can't run it success or share I format to string first?

Thank you for your reply but when I run the script the note said: cacls is now deprecated, Please use icacls. The problem is when I switch to icacls there is no parameter /P user:perm . I want to change the permission for vlc folder from full control to Deny(no access)

I understand because it's old fashion tech that's why cacls retired but still working at my batch. I tried this way icacls $env:USERPROFILE\AppData\Roaming\vlc /inheritance:r /deny "$($env:USERNAME):F" if same permission as my batch icacls $env:USERPROFILE\AppData\Roaming\vlc /inheritance:r /deny "$($env:USERNAME):(OI)(CI)(F)"

Prevent the current user delete the folder

Yes it works thank you very much for your hint

Thanks a lot I will refer it

Thank you for your suggestion we have followed the setting but still not working. Microsoft AAD team will check it for us.

Windows Store for Business Online App deployment we are using this method

Thank you for your suggestion but the app is installed for per user instead of local machine(i.e OneDrive) we can't use Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -match "OneDrive"} to find it at all. If I create script as app or package to deploy it when I choose user's right it works but popup UAC or choose administrative right it doesn't work because in administrator's path there is no OneDrive installed( As I mentioned the app installed for per user instead of local machine)

Thank you for your help but if we change LUA we must reboot it. I found the way to achieve my goal

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

ConsentPromptBehaviorUser DWORD

0 = Automatically deny elevation requests
1 = Prompt for credentials on the secure desktop
3 = Prompt for credentials (default)

https://www.tenforums.com/tutorials/112634-change-uac-prompt-behavior-standard-users-windows.html

I changed default value 3 to 0 (Needn't reboot)