Quantcast
Channel: ÇözümPark Forum - Güncel Konular
Viewing all articles
Browse latest Browse all 6793

AD üzerinde LockScreen için PowerShell çalıştıramıyorum.

$
0
0

Selamlar Arkadaşlar,

Yapımda GPO > File'dan C:/windows/Web/Wallpaper altına attığım bir foto var. 

Bu Fotoyu aşağıdaki PS Scripti ile LockScreen değiştirecek şekilde ayarlamaya çalışıyorum.

Kodlar : 

# Change this to the path where you keep the desired background image
$imagePath = 'C:\Windows\Web\Wallpaper\foto'

$newImagePath = ::GetDirectoryName($imagePath) + '\' + (New-Guid).Guid + ::GetExtension($imagePath)
Copy-Item $imagePath $newImagePath
 | Out-Null
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = (.GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters().ParameterType.Name -eq 'IAsyncOperation`1' })
Function Await($WinRtTask, $ResultType) {
    $asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
    $netTask = $asTask.Invoke($null, @($WinRtTask))
    $netTask.Wait(-1) | Out-Null
    $netTask.Result
}
Function AwaitAction($WinRtAction) {
    $asTask = (.GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and !$_.IsGenericMethod })
    $netTask = $asTask.Invoke($null, @($WinRtAction))
    $netTask.Wait(-1) | Out-Null
}
 | Out-Null
$image = Await (::GetFileFromPathAsync($newImagePath)) ()
AwaitAction (::SetImageFileAsync($image))

Ancak bunu GPO üzerinden User Conf. > Scripts > Logon ile PowerShell kısmından çalıştırsın diyerekten ekleme yaptım. 

Logon properties altında bulunan Show Files kısmından ekledim'de .ps1 dosyamı klasörüne ancak asla Kullanıcı Logon olurken çalışmadı.

Hakan abinin sitesinden baktığımda GPO üzerinden bastığım için Set-ExecutionPolicy ayarı yapmama gerek olmadığını da yazıyor ama asla çalıştırıp lock screen değiştiremedim.

Bu kodları elle çalıştırdığımda çok güzel Lock değiştiriyorda.

Takıldım arkadaşlar yardım etmeniz mümkün müdür?

Şimdiden çok teşekkür ederim.


Viewing all articles
Browse latest Browse all 6793

Trending Articles


Mide ağrısı için


Alessandra Torre - Karanlık Yalanlar


Şekilli süslü hazır floodlar


Flatcast Güneş ve Ay Flood Şekilleri


Gone Are the Days (2018) (ENG) (1080p)


Yildiz yükseltme


yc82


!!!!!!!!!! Amın !!!!!!!!!


Celp At Nalı (Sahih Tılsım)


SCCM 2012 Client Installation issue