Insert data from a plan text file to SQL server script
I have text file which contain huge data of authors and I want to dump this data into SQL Server database table. The file has information of authors such as: Index-ID, Name of author, Affiliation,...
View ArticleHow to read a file as a string instead of an array?
My purpose is to know which char is used as row terminator, whether \n or \r\n. So I need to first get the file as a string and the find whether there are \n or \r\n inside the string. When use...
View ArticleProblem using Get-CimInstance remotely for some namespaces
I am trying to get some info on my array controller remotely on an HP server. HP provides a namespace for this, and a class about the array controller. The following, using the get-WMIObject command,...
View ArticleHow to get script to stop if I press Cancel
I have a script that has popup boxes that ask for information. There is an OK and Cancel button on each. I want at anytime a Cancel is pressed for the script to stop. Any idea how to do that? I...
View ArticleMonitoring Windows Update
Hello, I am a student in a work-study program as a system administrator and I am a beginner on PowerShell. I am working on a WSUS Workgroup deployment project (no GPO) with the help of...
View Articleremove local user remotely for list of machines
Hi,i want remove specific local user from list of machines remotely i need your help.Mohamed Soliman System Administrator +971552997724i can do that for single machine using this script, is it possible...
View ArticleManaging shared mailbox rules with Powershell
Hi ExpertsI am creating a script to be used for managing a shared mailbox. To outline the scenario the script should be able to loop through the Inbox of the shared mailbox (from logged in user's...
View ArticleRemote change cert at RDP windows server 2012 r2
Try use Powershell to setup certificate RDP windows server 2012 R2 at 50+ servers.To use cmdlet Set-RDCertificate-RoleRDPublishingUsing Invoke-Command and have errorA Remote Desktop Services deployment...
View ArticleScript to move file from one server to another server location
Is there good ps script to move files with extention *.bak from Server A D:\Test Folder to\\ServerB\TestFolderI want to run script as schedule task into windows to run every week and move...
View ArticlePS to check which scheduled task are running with NON service account
Hello,We have about 1000 servers in our environment with windows server 2008/12/16.My boss today asked me to check on all of them scheduled tasks which are NOT using Service/System accounts.That is a...
View ArticleCreating Zip using PowerShell
Hi,When try to execute below PS code, getting issue. $source = "D:\Scan" #All Sub Folders and Files (Including Empty Folder) $destination = "D:\Temp_Scan\foo.zip" If(Test-path $destination)...
View ArticlePowershell check if file exists and is locked
I have the below PowerShell script called via a SSIS Process Task to check if a file is locked - how do I modify so it checks if the file exists first.If it does not exist, then exit with 999If it does...
View ArticleUse PowerShell to find Particular text from a TXT file
Hello,I am trying to create a script to pull/find the usernames from a Log Files.The log files is located in a .LOG The log file looks like the followingSERVER02 , COMPUTER209 , USERNAME1 , Wed...
View Articlescript to modify printer properties
I have a number of printers on a windows 2012r2 print server with port currently configured as raw using port 9100. There are quite a few that I need to reconfigure as lpr protocol with the same queue...
View ArticleUnique + Email
Hello,I hope one of you can see what I am doing wrong in this script.The script below gets the username from a LOG file. I dont want the usernames to repeat several times, so I used Get-Unique to get...
View ArticleSynthase PowerShell
$list = Import-Csv "$Script:PathOfThisScript\XXX.csv" $people = ForEach ($user in $list) { $Installationsgruppe_1 = $user.'Installationsgruppe 1' $Installationsgruppe_2 = $user.'Installationsgruppe 2'...
View ArticleConfigure Windows registry Audit settings
I'm trying to set ACL advanced permissions for Auditing (SetValue, CreateSubKey, Delete, ChangePermissions,TakeOwnership)PS C:\> Get-Acl HKLM:\SOFTWARE -Audit | fl Path :...
View ArticlePowershell cmd to extract multiple groups and members form a specific OU to .CSV
Hello all.I am trying to make a powershell script to extract multiple Groups and Users display name , surname- to .csv files named per group. The groups are in a OU 5 layers deep.corp.***.com...
View ArticleWindows Powershell Error - Invoke-RestMethod : Sendera:UnauthorizedUnauthorized
installed O365ServiceCommunication module and tried executing script but I am getting following error. Please help. Invoke-RestMethod : Sendera:UnauthorizedUnauthorized At...
View ArticleUnable to Install Azure AD
Hi, We are trying to install the AzureAD module. Not able to install the module. PS C:\Windows\system32> Install-Module AzureAD Untrusted repository You are installing the modules from an untrusted...
View Article