Basic powershell, wsus managing - windows

have few basic question for you, how to list servers belongs to group in wsus? Is there any possibility? I cannot find it.

From the WSUS server assuming it has the UpdateServices module installed:
Import-Module UpdateServices
Get-WsusComputer -ComputerTargetGroups "GroupName"

Related

Add Local Group User policies with powershell

I have a rather simple task. Is there any way to add a Group Policy under User-Configuration (particularly logon / logoff PowerShell scripts) ? I have seen tons of guides Like this one, but they are making it via GUI. I'd like to run a script, so all files are mapped from Network Fileshares.
I need an automation to configure master-image for citrix environment. (Maybe this can be achieved with BIS-F? or is there some sort of registry key? )
Thank you in Advance!
Here's a screenshot of this Policy (i can't make my own, because it's in German)
The New-GPO cmdlet creates a GPO with a specified name. By default, the newly created GPO is not linked to a site, domain, or organizational unit (OU).
See more: https://learn.microsoft.com/en-us/powershell/module/grouppolicy/new-gpo?view=win10-ps

Powershell module for SCCM Client

Is there a powershell module that I can uses on client system where I have the agents installed ?
I pushed the patches from SCCM Console to client with deployment status as "available" and need to run the install command from the machine where I have sccm agent installed. how can i do that ?
Yes, you can automate using the ClientSDK WMI classes and powershell. There is a good writeup about it here
https://timmyit.com/2016/08/01/sccm-and-powershell-force-install-of-software-updates-thats-available-on-client-through-wmi/
https://byteben.com/bb/identifying-and-installing-sccm-client-software-updates-remotely-with-powershell-and-trigger-a-vmware-snapshot-before-remediation-part-1-of-3/
It is better to just run a "Required" deployment on collection with the specific clients to want. See the docs
You may create that collection with query "where Client0 is 1" or doing fine-grain selection with direct membership. Here's how.
This way the SCCM Agent will be controlling the installation the whole way, and allow to:
Handle temporarily offline clients
Active users on the device
Scheduling and windowing
and more...

Exchange Server - New-MailboxExportRequest not exporting mailbox

A week back I upgraded my Exchange environment from E2K10 SP1 to E2K10 SP3.
Since then, I am unable to export mailboxes with New->MailboxExportRequest powershell script. Even though, I'm having right permission to export the mailboxes.
The cmdlet which I'm making use of is this:
New-MailboxExportRequest-Mailbox user-FilePath \\MailServer\PST\user.pst
The above cmdlet is identified and it is has been queued permanently.
Can anyone tell me why this has happened?
Did you have a DAG?
Have you tried to restart the Exchange Mailbox Replication service on all CAS servers to verify the result?
I suggest you to check the status of this mailbox database if it is mounted. You can use the following command to check this.
Get-MailboxDatabaseCopyStatus -Identity "mailbox database name"
Alongside, please make use of the Get-MoveRequestStatistics cmdlet to view full information about move requests.

View the active remote desktop connection on a given computer

I am looking for a tool to know if a given computer on the local network is being remotely accessed by a user or not and ideally I'd like to know who that user is. In my company, we share virtual machines and we keep have to ask members in the team if they use any remote computer. I'd like to have some kind of dashboard that can tell me what computer is being used, and what computer is free.
I am happy to use any kind of commercial solution that would require the install of services on each of the machines that need to be monitored or things like that.
The below is made easier if you're querying from a Windows client joined to the same domain as the system you are querying, and may require certain rights above and beyond a standard domain user. If you run into authentication/permission issues, that would be the first thing I'd check.
There is a tool available at least as far back as Windows XP called "qwinsta". Later versions of Windows have both qwinsta and "query session".
qwinsta /server:computer01
SESSIONNAME USERNAME ID STATE TYPE DEVICE
console 0 Conn wdcon
rdp-tcp 65536 Listen rdpwd
administrator 2 Disc rdpwd
That shows user "administrator" logged in but disconnected. Since in this example computer01 is a Windows Server 2003 system with the default "administration" RDP license, there's a second session listening for someone to connect.
Running the same command again after connecting to that previously disconnected session looks like this:
SESSIONNAME USERNAME ID STATE TYPE DEVICE
[unchanged output removed]
rdp-tcp#25 administrator 2 Active rdpwd
This is enough to answer "is someone currently active via RDP", and if you're using individual usernames, it should answer the "who" as well. If you're all using "testuser" or "administrator" or something, you'll probably want to know the answer to "from what client", and that is not given above.
The above gives a quick basic answer without needing additional tools. For more detailed information, you might look at the cassia library or PSTerminalServices (built on cassia). See some of the answers in this question for more detail.
My first thought on this was to use Sysinternals tools such as PsLoggedOn or LogonSessions. I then found reference to the previously-unknown-to-me qwinsta and rwinsta tools in this blog post from 2003.
You can use a PSModule named PSRdSessions, this module provide some simple funtions
sample of use
Get-RdSession -ComputerName Server01.domain.xyz # return [Cassia.Impl.TerminalServicesSession]
for return [hashtable]
Get-RdSession -ComputerName Server01.domain.xyz | Convert-RdSession # return
for return [pscustomobject]
Get-RdSession -ComputerName Server01.domain.xyz | Convert-RdSession | %{[pscustomobject]$_}

How do I add Active Directory support to Windows PE?

I want to query Active Directory from Windows PE 2.0, which is not supported "out of the box." Microsoft seems to suggest that this is possible, but not with any tools they provide. What do you recommend?
There seem to be instructions here, and the author claims to query AD from WinPE.
http://www.clientarchitect.com/blog1.php/2008/06/18/windows-pe-2-0-ad-scripting-requirements
i recently needed to use a connection to AD from WinPE to retrieve some computer informations, i tested the above solution and other one with ADSI but not working for me in ADK 1709.
My final solution is using WMI on a DC with differed Credentials so can get all i need just by one line :)
(Get-WmiObject -Namespace 'root\directory\ldap' -Query "Select DS_info from DS_computer where DS_cn = $($AccountName)" -ComputerName $Domain -Credential $myADCred).$($Myattribute)
$AccountName : is the name of the computer i am searching in AD
$Domain : fqdn name that pointing to your DC ex:(xyz.youtdomain.com)
$MyADCred : is a credential object containing user and password with the necessary rights on AD
$myattribute : is the info i am searching from the computer in AD.
have a nice deployment :)
Yassine
Installing the ADSI package from deployvista.com solved the problem for me, but your mileage may vary.

Resources