using powershell as non-admin
i wrote a batch file to run a powershell script. it works fine if i'm logged in with an administrator account, but it does not work with a non-administrator account. here is the batch file: taskkill...
View Article-replace will only work with "string", but not with $variable
Hi, I'm trying to read some replacement rules from a file (separated by "|") and use them on a given Text... $inputText = [system.IO.File]::ReadAllText("input.txt") $regex = Get-Content...
View ArticleClose modal message box with same process name as executable
I have a modal message box that I want to close programmatically but it has the same process name as the executable. In windows task manager under the applications tab the message box has a different...
View ArticleUninstall Program through PS
hi there, please to help with my case.what i want to do is to search for certain program uninstall string in registry - hklm:\ software\wow6432node\microsoft\windows\currentversion\uninstall On each...
View Articlereplace server path in all files with powershell script
Hallo guys, I need powershell script to change part of the path in all files (txt extension,more than 2000 files) in one directory. $_ -replace "\\servername\dir\dir\old",...
View ArticleSoftware Installs not logging in Event Viewer.
OS - Windows 7 Professional (x64bit) I am trying to find if there are ways to set so that when any software has been installed, it will get recorded in the event viewer. For example....I was trying to...
View Articlepassing variable to several scriptblocks used in remote sessions
With help I previously received on this forum, I have a script that runs from a domain server and 'does work' on a non-domain server. The work is divided up into jobs that are in scriptblocks that...
View ArticleTrying to make a Takeown.exe CMDlet, but locales is causing a problem
The problem is with the /D parameters in takeown.exe, that needs to be confirmed with language-independent yes/no start-letters (y/n in english, but ie j/n in danish). This picture should clarify:...
View ArticleCreating Windows Explorer with Powershell
Hi! I am new to Powershell, and I am still trying to get a hang of this so be gentle :) I have been asked to write an application so that users (managers) can see which groups have access to which...
View ArticleGet NTFS permissions in a ListBox.
Hello again! I'm still busy working on an application for managers to add users in a security group in Active Directory. What I have now is an form with a button that lets managers select a folder they...
View ArticleGet-member not listing all properties
Hello All, I'm a little rusty on powershell and theres something bugging me so its no doubt a simple answer. If I run the following command, it doesn't show me all the properties i could select:...
View ArticleBasic Else not working
This is a very basic script but I cannot get the Else to launch notepad. I have tried: & “C:\windows\notepad.exe"Invoke-Item “C:\Windows\notepad.exe"But it refuses to work when the condition is...
View ArticleSet-Acl Access denied
Hy all I created a powershellscript, which delete folder permissions and set new ones on the userprofile folder, which is stored on a fileserver. The permissions of the user are not inherited, they are...
View ArticleParsing from one .csv into another
I'm trying to parse a live log file and pull only the current months info out of it, and create a new file from that parsed data. I can get the output I want to the screen with this. $strGetDate =...
View ArticleAn alternative to Posh v3 | out-grid -passthru in Posh v2
Hello AllI need to read in a csv file and display to result to the user, I was therefore thinking about using Out-Gridview.Now the user needs to review the information display and then click OK to act...
View ArticlePowershell server specific modules / Windows 7
A general question: Will the server specific modules run as stand alone on my Windows 7 64-bit computer. i.e. If I copy the 'Exchange', 'Sharepoint', etc modules to...
View ArticleUsing Active-Roles and Variables via Invoke-Command
Hi all, Firstly, apologies if this is in the wrong area. I've written a simple script to copy AD Groups from one machine to another using the Active Roles Snapin. This works fine on computers with the...
View ArticleRenaming files
I need to rename a few thousand files that are in a few hundred sub-directories under the main folder. Each of the files have different naming conventions, however they all have the year 2011 in...
View ArticleSet-ACL problem passing a string instead of an object variable...
Hi, I have a problem that's giving me a head-ache but hopefully is simple to someone out there with a bigger brain than mine. Basically I have script for new user creation that picks up a variable...
View ArticleHow do I Make columns in PSobject closer?
I'm using the following code format below: $tobj = New-Object PSObject$tobj | Add-Member -Name "Server" -Value $Server -MemberType NoteProperty$tobj | Add-Member -Name "Scenario" -Value...
View Article