isql call unable to open input file
I am making a call with Sybase isql. It works from a standard command prompt but fails in Powershell. The SQL file is a simple "select count" for now. Command Prompt: H:\>isql -SSomeServer...
View ArticleNew-AdUser from CSV combining GivenName+Surname to Name
Hi Im trying to create a bunch of ad user via powershell. The problem is that the csv file ive got only has GivenName and Surname and not a Name peramete. The i thought i coould just combine them:...
View ArticleUpload Multiple Folders to same SharePoint Folders
I'm trying to upload folder contents to their respective folders in our SharePoint site. Is there a PowerShell script that will work with multiple folders and files? The only ones I've seen do it file...
View ArticleTrouble with Function
Hello all, I am trying to create a function that can be used to clear out the AD group memberships for an identified user. Here is what I have currently. $samaccountname ='*' + $(Read-Host 'Please...
View ArticleGetting Appointments from Shared Calender
Hi Community, I need to access a shared Calendar and I have already the powershell code for accessing private calander. As I see in the web I should use the GetShareddefaultFolder(Recipient,...
View Articlepowershell and IIS
Hi Guys and girls... I have searched high and low, but so far i havnt been able to find an answer.... We have many servers, running everything from IIS6, IIS7 and IIS7.5 I want to make an inventory of...
View ArticleMyInvocation.MyCommand problems
If I write a script Test1.ps which has following 2 lines $dir = split-path -parent $MyInvocation.MyCommand.Definition echo $dir it works fine. but I change it to function GetPath() { $f =...
View ArticleGetting "Error: Login failure: unknown user name or bad password" when trying...
I am trying to create a very basic scheduled task from a powershell script and am getting the message: "Error: Login failure: unknown user name or bad password" I only get this error on my Windows...
View ArticleReturn DirectoryServices.DirectoryEntry object from function
I'm writing a powershell script that will bind to a user object and then change some attributes on the object. I have a function that binds to the user object successfully. However when I attempt to...
View ArticleJust lookin for some basic help with a school assignment
Write a PowerShell command that does the following: Lists running services on your PCDetermine what services are dependent on those servicesThen display service name, status, and dependent services in...
View ArticlePowershell oh so newb
Ok, so trying to learn a little PS, I can get this to work in our environment: restart-computer -computername CXXXX-X -credential CXXXX-X\username The computer itself is not on domain but WG-CXXXX What...
View ArticlePowerShell suppressing exceptions doesn't always work
Try this code try { Add-PSSnapin Foo.Bar.Baz } catch {} From my knowledge of C# this should print nothing. because the exception is surpressed. However in powershell when you run this code you...
View Articlerunning out memory when run a window program from powershell even though the...
I have a window program. If I double lick it in window folder and run it, it works fine. However, if I try to run the file from powershell script, it will run out of memory. how should I do to fix this...
View ArticleProblem with Invoke-Command and functions
I have written the following code cls function GetBar() { $bar = "bar" $bar } function GetFoo() { $foo = "foo" $bar = GetBar $foo $bar } $cred = Get-Credential "domain\user" $result = Invoke-Command...
View ArticleCheck other Browsers than Internet Explorer
Hello, I'm a beginner in Powershell scipt... For some reasons, I want to determinate what users in my company are using other browsers than Internet Explorer and export the result in a csv file. The...
View ArticlePowershell v2 | My First Script, multiple easy questions
Ok, spent nearly 3 full days on google trying to get this script to work but I currently have a few issues, so this will be a pretty long post, and before we begin I wanna say I'm sorry I'm new to...
View ArticleCannot access the local farm. Verify that the local farm is properly...
I have added powershell via : Add-PsSnapin Microsoft.SharePoint.PowerShell but when I want to run "Get-SPFarm" in powershell, got the error: Cannot access the local farm. Verify that the local farm is...
View ArticleStrange copyitem issue
Hi, Whe i run this script it creates a folder instead of a file $base = "c:\FTPDownloads\" $ext = "*.avi" $source = "c:\downloads\New Folder (2)\" $astrix = "*" $sourcetrix = $source+$ext $destination...
View ArticleCan you pass a variable to a SQL Script with invoke-sqlcmd?
So this may be a stupid question but is it possible to pass Powershell variable to a SQL Script for instance $Datetime=Read-Host 'Enter Date' $Datetime=$Datetime.trim() $dbs=Invoke-Sqlcmd...
View ArticleChanging windows settings with powershell on Win7 (Advanced Sharing Settings)
Hi, I am trying to change "Password Protected Sharing" setting which is located at: "Control Panel" -> "Network and sharing center" -> "Change advanced sharing settings" What I would like to do...
View Article