Powershell and SaveBinaryDirect
Hi,I'm trying to convert this statement in vb.net into Powershell syntax.vb.netSP.File.SaveBinaryDirect(_ctx, "/test.pdf", fs,...
View ArticleCall a Variable Before Assigning It
I have a script that sends an email message to users and use splatting to set the send-mailmessage parameters. My code in brief form looks like:$NotifyMessage = @{ SMTPServer = $SMTPServer To =...
View ArticleInvoke-Command: Parameter set cannot be resolved using the specified named...
I'm running into an issue running Invoke-Command, I get the error below. I have successfully created a PSSession and ensured CredSSP is working properly (for both Server and Client roles). The command...
View Articleaccess DateImported
There is a value just for picture files, DateImported. Since a lot of programs don't give access to it for sorting and such I would like to write a script that would assign the DateImported to the...
View ArticleAny way to make Compare-object to work with Copy-Item
I am comparing 2 arrays. 1 is a list of files and the other is a folder location. I am checking to see if a user has the files by checking for them by their name inside that folder. So if they have...
View ArticleCan't find machine in AD
I have a text file with 1 computer name in it. I want to read this .txt file and for all machines within it move them to a new OU in AD. $NewOU =...
View ArticleSplit file path and remove forst 10 characters
IS there a way to remove the first part of the URL as follows:$url = "c:\scripts\test"So that I just have "test" ?I've tried replace and also split but nothign seems to work. So far I have$newtoplevel...
View ArticleCant enter-pssesion server to itself
Hi,I started having a strange powershell issue where i cant ps remote from server locally back to itself it gives me an error:PS C:\Windows\system32> Enter-PSSession ghsehwsw8k3v Enter-PSSession :...
View ArticleHelp with hash table
Hi, given the $variable with 2 propertiesCountry CityEngland LondonUSA WashingtonFranceParisWhen i query an AD user and get $user.city= 'London'How can i compare it against $variable.city...
View ArticleModify Web .config using powershell
Hi folks, while changing the site to claims based authentication we need to make some entry in the web.config of the sharepoint site,as a part of that we need to add the following...
View ArticlePowershell Script
Hi Experts,I have a powershell cube processing script which runs for around 3hrs.But due to Powershell Server V5 setting Idle Time out 100Min,the processing stops after 100minutes and my job fails.How...
View ArticleInstalling Adobe Acrobat updates
I am checking to see what version they have based on their registry key, and the switch will apply the next update.When I run this, it keeps looping over what version I have. It does NOT start the...
View ArticlePowershell 3.0: Printing part of the script only runs in Task Scheduler when...
The script runs normally when run outside of Task Scheduler.
View ArticleEnvironment variable powershell problem
Hi, I’m domain admin, and recently, I have created new COMPUTER env.var. under “Default Domain Policy” GPO.That env.var now can be found on every domain computer in the following registry path:...
View ArticlePowershell 3.0: Creating AD account issue with UserPrincipalName
Hello everyone,I am new here and my knowledge about Powershell is still under improving process so if my question would look as trifle please forgive! :)I have created script with params thanks to...
View ArticleSet-ADUser Replace Thumbnailphoto failure: Cannot bind parameter 'Replace' to...
Hi communityYesterday, I wrote a quick bit of PS script to set the thumbnailphotos for users in my test domain with a view to updating their SharePoint User profile photos. I get a weird exception...
View Articlereplace not working
Does anyone know why the replace part of this doesn't work? cd C:\archive\New folder $oldtoplevel = 'c:\archive\' #Archive directory $newtoplevel = 'c:\scripts\' $file = gci $file.directoryname $a =...
View ArticleFind Unknown Devices with PowerShell
When building a new server, I'll often open up devmgmt.msc (Device Manager) to verify that there are no "unknown" devices (those with the yellow exclamation point). Is there a way to do this with...
View Articlenew Line not working
$session = New-PSSession -ConfigurationName microsoft.exchange -ConnectionUri http://ph-cdo-caexch01.gbsorg.net/powershell -Authentication kerberos Import-PSSession $session $isTherePossibleQueue =...
View ArticleProblem getting powershell script to export defrag recomended to sql db...
Im trying to grab DefragRecomended from a Servers defrag analysis and plug it into a SQL DB, the output works, adds to the DB but it is NOT inserting the TRUE or FALSE-DefragRecomended output into the...
View Article