Powershell

18K

Solutions

8K

Contributors

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi,

What is the attribute in Active Directory for user enabled or disabled?

Thanks
0
CompTIA Security+
LVL 12
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

I'm looking for a way to get files associated to an user ID that I've derived from a specific StorageZone for Citrix ShareFile.  At this point I've been able to get the list of user ID's but I'm having challenges finding any examples of getting the associated items to user ID.

I've plagiarized some code and have this so far:

Add-PSSnapIn ShareFile

$sfClient = Get-SfClient –Name "H:\unitedlex.sharefile.sfps"

$sfEmployees = Send-SFRequest -Client $sfClient -entity Accounts/Employees -expand "User,User/DefaultZone,User/Security"

$fileOutputEmployee =@()

foreach($sfEmployee in $sfEmployees) {
  $fileOutputEmployee += New-Object PSObject -Property @{'UserId'=$sfEmployee.User.Id; 'FullName'=$sfEmployee.User.FullName; 'Email'=$sfEmployee.User.Email; 'DefaultZoneId'=$sfEmployee.User.DefaultZone.Id; 'DefaultZoneName'=$sfEmployee.User.DefaultZone.Name; 'LastLoggedOn'=$sfEmployee.User.Security.LastAnyLogin}
}

$ShareFileUSEastEmployees = $fileOutputEmployee | where DefaultZoneName -Like "ShareFile US East"

$EmployeeID = foreach($ShareFileUSEastEmployee in $ShareFileUSEastEmployees) {
    Send-SfRequest -Client $sfClient -Entity Users -Id $ShareFileUSEastEmployee.UserId | Select Id
    }

Now that I've got the list of user ID's associated to a specific zone; how do I then get the items associated to the ID?
0
After removing our on premise exchange server, we no longer have the ability to edit the "Send on Behalf of" or "Send As" properties of our Active Directory synced distribution lists or mail enabled security groups.
If we create a distribution list, or group in Office 365, we can edit these fields in Office 365.  
Currently, we are looking at deleting our on premise groups/distribution lists, and recreating them in Office 365. (If there is a better way, without using 3rd party tools, please let me know!)

I can use the powershell command "get-adgroup" to find the groups. (I plan on doing distribution lists first, and then mail enabled security groups later, as I have to verify they're not in use for local shares.) and I can use "get-adgroupmember" to find the members of the group.

For ease of creating the new distribution lists in the cloud, it would be nice to have the distribution group name, and email, followed by all members of the group in a file. (Or files.) So that it can be read, while creating the new groups in Office 365.

What is the easiest way to accomplish this?

Thanks for any assistance.
0
Good Day,

i have been assigned a task to get a list of all the SNMP community strings for a large number of servers.  This can easily be done with powershell remoting but this has been disabled as a security measure.

We do allow WMI monitoring on our network.  

I am looking for a powershell script that most likely will have to use gwmi (pssession's do not work) that can collect all the SNMP Community strings from each server on the network.  We do not want to gather the printer SNMP strings only those our systems use.

Help is appreciated.

The Key I believe I need to gather is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\TrapConfiguration

I can run the script below to get the name of the community string I need.
Get-Childitem -Path Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\TrapConfiguration -EA Stop

Open in new window

0
Please provide a PS script to export all printer drivers from a Print Server and import to a client Windows 10 system.
0
Recently a users mailbox may have been compromised to send a phishing email.  I checked the message tracking log and it showed that an email with the same subject was sent from the employee to 3 other employee emails.  I originally thought that this was a spoofing attempt and the email originated off-site.  But, at this point from what I can tell the logs indicate otherwise.  

Is there any way I can determine whether if any other users, computers are forwarding the email via Powershell?  
Is there any way I can find the originating IP?  I currently don't have access to the original email to view the headers.
0
Hi Experts

We are using Exchange 2013 and management wants to know what is the typical message size being sent by users.
They need to know statistics of message for the past 1 month.

I tried running this https://gallery.technet.microsoft.com/exchange/Exchange-2007-2013-email-b66c5543 only for 2 days but it is still stuck in powershell since yesterday.
I got 2 mailbox databases and the size of each is around 600GB, total about 1TB.

Is above link correct to get statistics of the messages daily sent/received? How longs it takes usually for what size of database?

If above is not what I supposed to run, what is the quickest way to get daily messages sent/received for the past 1 week?

My objective is just to get all individual messages size being/sent/received (internal/external).
Any powershell comand that can generate all individual message size for X days ?

Thanks
0
What steps do you recommend for UPLOADING Employee Photos to my Window Server 2016, Active Directory ?

Details
 ** # of employees = 100
 ** photos = under 100kb in size, named firstname_lastname.jpg
 ** AD Account Name = firstname lastname
 ** security = IT (me) will do upload
 ** software = powershell/etc is fine, or something like https://www.codetwo.com/freeware/active-directory-photos
0
I have a folder that is used to hold several versions of files.   The main folder contains many sub-folders all named by date.   A particular file can occur in any date folder if it has been revised as it retains the same name.     What i need to do is copy out all the files from this folder structure and get only the most recent version of any file by name ignoring by the date of the file as listed in the OS.
1
I just discovered the SQLSERVER Module for Powershell and would like to use the.
get-ChildItem2 -Path w:\ -File -Recurse | Select  DirectoryName,Name,CreationTime,LastWriteTime,LastAccessTime,Extension,Length,Mode | Write-SqlTableData -ServerInstance 'sandboxhost' -DatabaseName 'NETAPP_INVENTORY' -SchemaName dbo -TableName 'files' -force

Open in new window

to write to a table.  The data structure is 11 TB with over 100 million files.  

From my initial testing of small directory structures it works well.  My fear is that the system will not be able to hold all the data before writing to the SQL server.  Is there a way to chunk this up or make it more efficient?

Here is what I am doing to help or not:

$Dir = 'W:\'
$DirLists = (Get-ChildItem2 -path $dir -Directory).FullName

Foreach ($dirlist in $DirLists)
{
Write-Host (Get-Date)
Write-Host $dirlist
get-ChildItem2 -Path $dirlist -File -Recurse  | Select  DirectoryName,Name,CreationTime,LastWriteTime,LastAccessTime,Extension,Length,Mode | Write-SqlTableData -ServerInstance 'sandboxhost' -DatabaseName 'NETAPP_INVENTORY' -SchemaName dbo -TableName 'DUMP' -force
Write-Host
}

Open in new window

0
Build an E-Commerce Site with Angular 5
LVL 12
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Hi,

Is there a way by GPO or PowerShell to remove a specific printer driver package in windows 7 and Windows 10?

Thanks
0
Is there a way via Powershell that would allow me to export messages deleted by a user to a PST File.

I have a situation where we need to gather deleted emails as evidence from an active mailbox.

The command would
  1. Query the mailbox for hard deleted items
  2. Export just these to a PST file
0
Hi,

I have 2 same printers shared from Windows 2012 server. One is working but not the other. Is there a way to copy printer setting between 2 printers?

Thanks in advance
0
Hi,

Is there a tool to read and modify NTUSER.DAT file?

Thanks
0
Hi All

I am trying to bulk add guest users to Microsoft Teams using a CSV file and not having much luck.

I have the powershell script to bulk add different teams but I don't want to add the users as part of this process as I plan to add/remove guest users on a daily basis.

Regards

Si
0
SFB Powershell module not working. I am unable to connect and receive bad gateway error. I can connect to all of our other Office 365 online resources/cmdlets using powershell but unable to connect to SFB. Anyone experience this issue in the past and can assist?
0
Although I'm running an elevated PowerShell session, when I attempt to get the window titles with the PowerShell command below, they are only displayed for my own processes, and not for all users. Remaining fields are displayed for all users.  Any way to get them? Thanks.
Get-Process | Where sessionid -ne 0 | sort sessionid, name | 
	Format-Table name, sessionID, mainwindowtitle -autosize

Open in new window

0
Hello,

I am trying to configure DHCP options for HP Thin Clients to boot into PXE. I am working off this documentation from HP

http://h10032.www1.hp.com/ctg/Manual/c04333240

I understand about PXE, and what I don't really understand why HP says 43 and 60 should be removed

And want to do is have these options set in powershell script because we have several different subnets
0
I have a windows 2012 AD Domain. The Telecom department came to me with a list of user accounts connected to our phone system They want a list of the last time each account has logged in. In checking ADUC, it appears if I display a user name and go to the OBJECT tab, the MODIFIED tab reveals the last time an account connected. I am trying to do an advance search and search for all accounts starting with AVAYA- and the MODIFIED date of each account. Assuming this does indicate the last time an account connected, which it appears to . I do not care if I use ADUC or a Powershell script. An out put file would be nice too if possible. OR if someone has a better way to get a list of the last time all accounts starting with Avaya- logged in, that would be fine too. ALl ideas welcome
0
Exploring SQL Server 2016: Fundamentals
LVL 12
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

I'm very familiar with extracting information from register keys using VBScript, but I'm having trouble trying to extract a policy security setting on my machine using VBScript.  I can get to the information I need using gpedit.msc, and navigating to the folder  "Local Computer Policy\Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options", but I need to do this via a script that can be run on the laptop of everyone in my organization (to audit a security setting).  I don't want anyone running gpedit.msc on their machines.

I've tried using PowerShell, but I don't want anyone to have to change any settings on their computer (right now the script execution permission on our laptops is "restricted").  I would really like a VBScript that someone can just double-click and have it produce a file that I can then have them send to me.  I've searched the internet for hours and cannot find what I'm looking for.  Can anyone help?
0
We have two Subscription of Office Enterprise E3 bought in diffrent time . One of our Subscription will end soon.

I need to find some solution to list witch user are connected to Subscription witch end soon.

I was trying to do it by PowerShell but the only efect witch I get is a list of all user with active licences. Tha's all

Please help.
0
Hello All,

I would like to get the list of all the public folders and the size. I got the below cmdlet, however i was unable to get the size of PF.

I just want identity, User, AccessRights and Size.

Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select Identity,User,{$_.AccessRights} | Export-CSV "C:\PFPermissions.csv"

Can anyone please help me.

THanks
Krish
0
I need to PowerShell script setup off DFS namespaces.
I've already scripted the creation of the folders and creating the share, but can't seem to work out how to script the DFS Namespace creation.
Can someone please help.

Domain: DomS3.local
Server: DomS3-DC1
Share Name: Test
Share target: c:\data\test

Many thanks,

Alec
0
Hi,

We have sharepoint 2016 and having an issue with the people picker.
It's showing users from forest\Accounts\Ext_users
We want all accounts in that specific Organizational Unit to be excluded from the people picker.

I found this and its helpfull.. http://www.sharepointdiary.com/2012/04/people-picker-filter-in-sharepoint.html 
But it doesn't specifically talk about excluding a specific OU. And I'd like the fix to get applied on the entire web application. Not just a site collection.


Anyone can help me with this?

Thank you so much for your help.
0
I use different netsh commands to run individual back ups of DHCP servers.
For example:
netsh dhcp server dump > \\10.0.0.1\dhcp$\Area1\dhcpcfg.txt
netsh dhcp server export \\10.0.0.1\dhcp$\Area1dhcpdb all
pause
netsh dhcp server dump > \\10.0.0.2\dhcp$\Area1\dhcpcfg.txt
netsh dhcp server export \\10.0.0.2\dhcp$\Area2\dhcpdb all
pause
I have to go on each server to run this
Please indicate a power shell command I could use to run once and back up all my dhcp servers
0

Powershell

18K

Solutions

8K

Contributors

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.