Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

set wallpaper using OU-policy

$
0
0

Hy,

I'm trying to write a script for a GPO to set a default background for a OU.
This is what i came up whith:

PS C:\> new-gpo -name WP_ICT3 |new-gplink -target "ou=All_ICT,DC=WD,DC=local" | Set-ItemProperty -path H:\ICT_DATA\WP\logo-DictB.jpeg -Name "Wallpaper
 ICT" -Value 10

It results in the following error:

Set-ItemProperty : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the
input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:73
+ new-gpo -name WP_ICT3 |new-gplink -target "ou=All_ICT,DC=WD,DC=local" | Set-Item ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.GroupPolicy.GpoLink:PSObject) [Set-ItemProperty], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Does anyone knows what i'm doing wrong? And can you explain it?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>