Powershell to Enable "Protect from Accidental Deletion" on ALL OU's
Howdy folks...The client I am currently working with has partially set the "Protect from Accidental Deletion" attribute on their AD...I want to extend this feature to ALL organisation units (OUs) in...
View ArticleExport users membership and attribute
HiI need to search my AD for users that have an "extensionAttributte2" field populated and if they do I also need to know if they are members of the "AccountsGroup" AD Group.How can I create a report...
View ArticleProblem with looping...
Hi,I'm in the process of writing a script which will update groups based on AD Attributes (department). This works great and reads a CSV with a list of groups and departments and adds uses to the...
View Articlewindows 2012 cmdlet to rescan storage?
After expand a vmdk file, I log onto the Windows 2012 server, and open up Server Manager | File and Stoage Services | Volumes | Disks. At TASKS drop-down, choose Rescan Storage.Windows 2012 has a...
View ArticleCurrent Date output of export file
HiI am using below script to get HR samaccount from AD. Now I want to output should come with date name when the script run.Also can send that current date output to my email...
View ArticleProblems with running get-childitem on directory structure
I have the test script below that I am working on that dies when it gets to the System Volume Information folder with error shown at the bottom. I know that it is this folder because I can put a test...
View Articlehow to export csv without doublequote
I ran the following comandls |export-csv "d:\a.csv"The result is like the following, every field is double quoted, is there any way to not export double quote. Currently the silly approach I used is to...
View ArticleI need help about script to bulk remove something
Hi all,I need to compose a PowerShell script to bulk remove some items Here is an example: 1. First, I run:PS C:\Users\> Get-ManagementRoleEntry "test1\*" Name Role...
View ArticleGetting Outlook folder permissions for all Exchange users
I have a script that will pull permissions for all Exchange mailboxes for the calendar folder. This works quite well for just the calendar folders. However, I need to search all folders (not just...
View ArticleFind all TotalSeconds
Hi,Pls, I have find all TotalSeconds$xtime = "00:03:20" $xSec = new-timespan -Hours $xtime $xSec = $xSec.TotalSeconds $xSecHow i have to do?My best regardsArnold
View ArticleHow can I create a share with New-SmbShare and specify a Local Group
Using the New-SmbShare cmdlet in Powershell 3.0, I would like to create a share and specify a Local Group as the ReadAccess group. Code looks basically like:$serverName = "Server01" $groupName = "Share...
View ArticleCheck Whether drive exists
function get-checkdrive($server) { write-verbose "check drive -started" $check= 'D:\' # no escape $testobj=get-wmiobject win32_volume -filter "DriveLetter= 'D:'" -computername $server $caption=...
View Articleread csv files and produce email with attachment
I have csv files being created that have a header record than row 2 has corresponding data.\\servera\csv\*.csv...
View ArticleHow to querry an specific OU for users with the same last name and first name ?
Hello,I have an OU called "COMPANY - New Users" but i am trying to code the scenario where there is a user already with identical firstname and lastname as new user to be created.Currently on that OU,...
View Articledate join and emp id bulk add
Dear TeamThe following objects have been added to the active directory 2008 R2. there are about thousand of users in my existing environment. My question is possible way of adding join date...
View ArticleScript block literals are not allowed in restricted language mode or a Data...
Here i execute power shell Scripts by using in C#:PSCredential psc = new PSCredential(@"domainname\username", SecurePswd); WSManConnectionInfo wsmConn = new WSManConnectionInfo(new Uri(strSystemURI),...
View ArticleSome Storage CMDLets do not work under WinPE
I have built a custom WinPE based on W2012 and included Powershell and a number of the Powershell CMDLets such as SMB, DISM, and Storage. Everything works fine. When you boot the WinPE disk and do a...
View ArticleScript for Delete a specific Folder and Move the other one to rhe C:\
HiI need a PowerShell script for Delete a specific Folder and Move the other one to the C:\at the moment I have a folder called FileNotToBackupunder this folder I have 2 folder called Script and...
View ArticleDynamic Where-Object Filter
I'm trying to use a dynamic where-object filter by building it and assigning it to a variable and then using that variable, something like the following:$filter = "`$_.thing -match...
View ArticlePowershell Audit workstations
Hello guys,I am starting with powershell and I'd like to verify with you about how can I proceed with a work I need to do...I want to create a script to audit workstations comparing the software...
View Article