Sunday, January 30, 2022

two deploymentshares

two deploymentshares

hello all

does anybody use MDT and two deploymentshares? I think it is and better distinction if you use server and clients.

If yes, can you tell me you experience


Chris


Reply:
I use (2) DP's all the time. One for Reference Build and one for Production deployment.

------------------------------------
Reply:

I use 2 deployment shares too. One 2012(xp, vista, 7) and one 2013 (7,8).

No problem at all. They are two different shares.


------------------------------------
Reply:

hi all

today we use one share but we can't have difference $OEM$ folders for client and servers

and second problem is that we need different passwords (ok you can set customsetting.ini, but it is complex to manage if you have more tasksequence)

we have 5 clients and I must define all five tasksequence with same pwd

[1]
MachineObjectOU=ou=client,dc=company,dc=com
AdminPassword=xyz (not our real pwd)

[2]
MachineObjectOU=ou=server,dc=company,dc=com
AdminPassword=123


Chris


------------------------------------
Reply:

can you tell me a little how to on WDS. Does MDT and new deploymentshare automatical generate the WDS entry. Do we need a other boot image?


Chris


------------------------------------
Reply:

Hi,

Two deployment shares should work without any issue.

But you can also have a look at the "linked deployment share" feature wich will allow you to have two DP and to easily replicate content (applications, tasks sequences) from the parent DP to the linked DP.

Regards,


My technet galleries contributions : <a href="http://gallery.technet.microsoft.com/ConfigMgr-Driver-Injector-aae7d17d"> ConfigMgr driver injector</a> // <a href="http://gallery.technet.microsoft.com/SCCM-Collection-Splitter-e1c82b06"> SCCM Collection splitter</a>


------------------------------------
Reply:

If you have two different deployment shares, and you want to connect to them automatically, generally you'd use two different boot images. Having said that, if you erase the "DeployRoot" property from Bootstrap.ini, you should be prompted about which share to connect to. (Don't quote me; it's been a while since I tested that.)

WDS should be used to enable PXE; you shouldn't need to do anything within WDS once it is working as needed. Basically, set it and 'forget' it.


-Nick O.


------------------------------------
Reply:

I'm actually using two deployment share to build dual boot images. The first deployment share allows some input, then during the task sequence it makes two partitions (and active patitions) and copies the boot loader to a USB. It will load the first image to the second partition and at the end of the task sequence I'm having it load the LitetouchPE_x64.wim file from DS2 and then it reboots. The second deployment share is fully automated and load the image to the first partition overwriting the boot loader and making it the first bootable OS.

its a neat trick. its probably not the best way to do it, but it works


Richard J Tracy II


------------------------------------

Is Excel a database program?

I have always maintained that Excel is a spreadsheet program, and not a database program.  My employers continue to refer to it as a database.  I've always maintained that, if they want a small database, Access is the program to use.  For bigger projects, I recommend SQL.  Have I been wrong all this time?  Should I give in and not correct them when they refer to Excel as a database?

Reply:

Excel has some database-like capabilities, but it is definitely not a database program. By far the most serious problem is that Excel does not force data to be of a specific type (yes, I know that Excel has data validation, but that is vulnerable).

Anyone who has had to convert a series of Excel sheets to a real database such as Access know how much 'data cleaning' has to be performed...


Regards, Hans Vogelaar (http://www.eileenslounge.com)


------------------------------------

Anyone here using SCCM+MDT to deploy HP Proliant servers?

Hello,

I'm having a bit of trouble imaging some HP Gen8 Proliant servers. I've downloaded the HP Insight Manager from:

https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=IMDVD#7.1

which includes an SCCM 2012 SP1 integration kit. This kit adds special Proliant task sequence steps, and includes drivers for Server 2008 R2 and Server 2012.

However, during the deployment, the drivers for the server never install.  Also, according to HP, these drivers support a wide variety of servers, but there aren't that many drivers included in my opinion.

Has anyone else used this Insight Manager from HP? It seems awesome, but I am not having much luck.

The drivers included:

My Task Sequence Apply Drivers Step:


Reply:
I have deployed Proliant G8 servers before but at the time there was only the ConfigMgr 2007 tools, and so this led me to using the Proliant Support Pack and install this as a package after the Setup Windows and ConfigMgr step.

My Personal Blog: http://madluka.wordpress.com


------------------------------------
Reply:

That is an interesting idea.  All I want from the Insight Manager stuff is the drivers, which I seem to have.  Perhaps my problem is a more general driver installation problem, and not an HP server problem.

Do you have any details or examples of how you went about installing the Support Pack as a package, MadLuka?


------------------------------------
Reply:

Hi a have the same problem ending up installing net driver only and later apply hpsum

send me an email so a can send you the steps a did :-)

 
rixtrix@gmail.com

------------------------------------
Reply:

Ricky,

Not trying to be rude, but is there any reason you can't list the steps here so that everyone may benefit? If not, I will send you an email.

Thanks!


------------------------------------
Reply:

Here's the site I used when I worked on my Server OS deployment task sequence.  If you are not already using MDT integrated task sequences then you should really consider it.

http://deploymentbunny.com/2011/04/05/windows-server-2008-r2-deployment-using-mdt-2010-part-ii-doing-the-hp-stuff/

The support pack install script from the link above worked great for me, but as Ricky pointed out you should get hold of the NIC driver, throw it into a driver package and install that after applying the OS image to the disk but before the Setup Windows and ConfigMgr step.  You then install the Proliant Support Pack before you install any software and it will take care of all the drivers for you.

Andy


My Personal Blog: http://madluka.wordpress.com


------------------------------------
Reply:

I got it working using this link here: http://chireven.blogspot.com/2011/07/adding-hp-proliant-support-pack-psp-to.html

Thanks for the help everyone!


------------------------------------
Reply:
I have been using SCCM OSD 2007 and 2012 to deploy to HP proliants bare metal for some time.  The only things I've needed is to ensure drivers are in the boot image and that I am installing the service pack for proliant.  Looks like you've done that but just wanted to reiterate that it isn't necessary to use insight manager.

------------------------------------
Reply:

Hi,

I want to use MDT deploy both HP ProLiant Gen8 & Gen9 as well. 

Can you share me an idea to inject this step into Server Deployment Task Sequence?
- Create RAID Array, for example:

hpssacli.exe ctrl slot=0 array A create type=ld raid=1

- Create Network Teaming :

New-NetLbfoTeam –Name Teaming -LoadBalancingAlgorithm Dynamic –TeamMembers Ethernet* -Confirm:$false


Thanks in Advance,
Jobbo


Sharkrit


------------------------------------
Reply:

Just add any neccessary Network Drivers (e.g. for 10Gbit Adapters) to your Boot-Image and Apply them via Task-Sequence.

For the main Drivers and Tools you can automate the HP Smart Update Manager in the Service Pack for Pro Liant. Nickolaj wrote an excellent guide for that: http://www.scconfigmgr.com/2014/04/06/install-hp-service-pack-for-proliant-during-osd-with-configmgr-2012/

Works on G7 / Gen 8 / and Gen 9 Servers with ConfigMgr 2012 R2 (without MDT) for me without any issues.


Best regards, Simon



------------------------------------

How to convert ReFS disk to NTFS?

When I created my file server, apperantly I have created ReFS instead of NTFS. Which is bad for my DFS replication. As you all know for sure, I cannot create replication between these machines because the replication can occur only on NTFS. I tried to search the forum but no joy for me. I accept any kind of ideas.

Best Regards!


Reply:

You can't convert. You'll need to backup, reformat, restore.

http://blogs.msdn.com/b/b8/archive/2012/01/16/building-the-next-generation-file-system-for-windows-refs.aspx

 

 

 


Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]

Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.


------------------------------------
Reply:
The amount of files is small so I used "xcopy" to another drive, formatted and did the same back to the File Share. Thanks :) It worked.

------------------------------------
Reply:

Sounds good, you're welcome.

 

 


Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]

Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.


------------------------------------

Lync 2013 Desktop Sharing

Hi All,

I am troubleshooting an issue with Lync 2013 Clients not able to Desktop Share and Application share between two locations. The same Lync Infrastucture is used for other Locations and the Desktop\Application sharing works fine.

With the little research, I can confirm the impacted Segments have below Ports opened from CLient to the Lync front End.

TCP 5061

TCP 80

TCP 443

TCP 8057

The Lync Connectivity Analayser looks good on those IMpacted PC's. Portquery confirms the above ports are opened.

The sharing fails with Network error.  I strongly believe this is a Network related issue. ANy pointers will be realy helpful.

Regards,

Avis

  • Edited by Avissh Thursday, September 17, 2015 4:09 AM

Reply:

Hi Avis_29,

You could check the network with Wireshark on both client or use the Snooper tool from the debugging tools to analyze the trace of both clients.

Check also that the needed ports are open to the Edge server, also UDP 3478.


regards Holger Technical Specialist UC


------------------------------------

SCCM Console is lying to me! Content shows as distributed but it isn't.

Hi there,

I had many issues in the past few weeks and I found a new one yesterday.
As per my other posts, I have taken all of the advices and applied them. One of them was to split the packages for the Updates, in particular Office's!

So now I have a few different Deployment Packages for Office 2013 and 2010 updates. Now, I've noticed that one of them, in its properties, is lying to me!

When I click on the Deployment Package, the Status tells me it's distributed correctly to 6 DPs and nothing in progress (same under Monitoring).

Now, I tried to distribute this to another DP (I've got like another 20 to go!) and it didn't do anything. It just sat there saying that it was deployed to 6 DPs. Now, as I said above, this is a brand new Deployment Package so I am distributing this myself little by little. If I go to Properties of this Deployment Package > Content Locations I see 11 DPs in there! Liar! :)

So, I tried to:
- Update the distribution points (as I had to do for lost of packages in the past few weeks).
- Tried to remove the DPs from the Content Location (nothing, as soon as I close and re-open its properties I get the same list of DPs under content locations).
- Target another DP (nothing happened, I might try another one).

When I remove these DPs from the Content Locations nothing happens in the logs either (checking distmgr.log and PkgXferMgr.log which are the ones I always look when I distribute any content).

UPDATE #1:
Distributing the content to another DP works, I still have these ghost DPs in there though! :(

UPDATE #2:
I tried to either distribute (Start-CMContentDistribution) and remove (Remove-CMContentDistribution) the package from these DPs via PowerShell but also here no luck. When I try to distribute it, it tells me it's already distributed, when I want to remove it, it asks me whether I want to go ahead or no, I say (Y)es but then it stays there doing nothing..

UPDATE #3:
I am able to see the content on the DP through Content Library Explorer but it's greyed out?

Any help is really appreciated! Thank you!
S





Reply:

I have finally sorted this.

I ended up creating a ticket with Microsoft.
Here's how I fixed it:

http://www.itdroplets.com/content-location-shows-the-package-as-distributed-but-its-not/

Cheers



------------------------------------

Issues with Logitech Bluetooth Keyboard and Mouse

I am having issues using both the Bluetooth keyboard and mouse at the same time. Each device works flawlessly when connected separately. When the mouse is connected first the keyboard repeats keys and has a significant latency issue once connected. When the Keyboard is connected first the mouse will not work once connected.

All bluetooth drivers and device drivers are up to date.

Is there a known issue with running multiple bluetooth devices at the same time? Is there an upgrade I can make to improve bluetooth functionality? Any advice/guidance that you could lend would be greatly appreciated. Please see below for the equipment in question.

Equipment being utilized:

HP Elitebook 840

Windows 7

Logitech Bluetooth Mouse M557

Logitech Bluetooth Illuminated Keyboard K810

Much thanks,

JR



Reply:

Hi!

Check this thread; http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/bluetooth-mousekeyboard-failing-when-used-together/c2be88a8-9ad3-4d2c-98a5-d9a96c36d29f?auth=1

It should be possible to run both devices at the same time, but you could try and buy a Bluetooth-dongle and see if this solves the problem.

Best regards
Andreas Molin


Andreas Molin | Site: www.guidestomicrosoft.com | Twitter: andreas_molin


------------------------------------

Start a remotely scheduled task

Hello, everybody ... see if you can give me a help!


I need a script where I can create a scheduled task on a remote computer, but that this script I can impute data such as: hostname, and the date when the task should be started. I found this model below the net, however it is to run locally. How could you adapt it to a remote procedure?


Best Regards.

'=======================  Script Start ================================

'------------------------------------------------------------------
' from the time the task is registered.
'------------------------------------------------------------------

' A constant that specifies a time-based trigger.
const TriggerTypeTime = 1
' A constant that specifies an executable action.
const ActionTypeExec = 0   

'********************************************************
' Create the TaskService object.
Set service = CreateObject("Schedule.Service")
call service.Connect()

'********************************************************
' Get a folder to create a task definition in. 
Dim rootFolder

Set rootFolder = service.GetFolder("\")

' The taskDefinition variable is the TaskDefinition object.
Dim taskDefinition
' The flags parameter is 0 because it is not supported.
Set taskDefinition = service.NewTask(0) 

'********************************************************
' Define information about the task.

' Set the registration info for the task by 
' creating the RegistrationInfo object.
Dim regInfo
Set regInfo = taskDefinition.RegistrationInfo
regInfo.Description = "Inicia script de remoção de AdminLocalTEMP"
regInfo.Author = "Service Desk"

'********************************************************
' Set the principal for the task
Dim principal
Set principal = taskDefinition.Principal

' Set the logon type to interactive logon
principal.LogonType = 3


' Set the task setting info for the Task Scheduler by
' creating a TaskSettings object.
Dim settings
Set settings = taskDefinition.Settings
settings.Enabled = True
settings.StartWhenAvailable = True
settings.Hidden = False

'********************************************************
' Create a time-based trigger.
Dim triggers
Set triggers = taskDefinition.Triggers

Dim trigger
Set trigger = triggers.Create(TriggerTypeTime)

' Trigger variables that define when the trigger is active.
Dim startTime, endTime

Dim time, timefinal

timefinal = inputbox("Informe a data final")

time = DateAdd("n", timefinal, Now)  
startTime = XmlTime(time)

time = DateAdd("n", timefinal, Now) 
endTime = XmlTime(time)

WScript.Echo "startTime :" & startTime
WScript.Echo "endTime :" & endTime

trigger.StartBoundary = startTime
trigger.EndBoundary = endTime
trigger.ExecutionTimeLimit = "PT5M"    
trigger.Id = "TimeTriggerId"
trigger.Enabled = True

'***********************************************************
' Create the action for the task to execute.

Dim Action
Set Action = taskDefinition.Actions.Create( ActionTypeExec )
Action.Path = "C:\Windows\temp\removeadmin.ps1"

WScript.Echo "Task definition created. About to submit the task..."

'***********************************************************
' Register (create) the task.

call rootFolder.RegisterTaskDefinition( _
    "AdminLocalTEMP", taskDefinition, 6, , , 3)

WScript.Echo "Task submitted."



'------------------------------------------------------------------
' Used to get the time for the trigger 
' startBoundary and endBoundary.
' Return the time in the correct format: 
' YYYY-MM-DDTHH:MM:SS. 
'------------------------------------------------------------------
Function XmlTime(t)
    Dim cSecond, cMinute, CHour, cDay, cMonth, cYear
    Dim tTime, tDate

    cSecond = "0" & Second(t)
    cMinute = "0" & Minute(t)
    cHour = "0" & Hour(t)
    cDay = "0" & Day(t)
    cMonth = "0" & Month(t)
    cYear = Year(t)

    tTime = Right(cHour, 2) & ":" & Right(cMinute, 2) & _
        ":" & Right(cSecond, 2)
    tDate = cYear & "-" & Right(cMonth, 2) & "-" & Right(cDay, 2)
    XmlTime = tDate & "T" & tTime 
End Function

'=======================  Script End ================================


VagnerOliveira

  • Changed type Bill_Stewart Monday, October 19, 2015 4:31 PM
  • Moved by Bill_Stewart Monday, October 19, 2015 4:31 PM This is not "someone debug/fix/rewrite long script for me" forum

Reply:

The documentation for that COM object is here:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa383607.aspx


-- Bill Stewart [Bill_Stewart]


------------------------------------
Reply:

SCHTASKS can run remotely and is very easy to use.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb736357(v=vs.85).aspx


\_(ツ)_/


------------------------------------
Reply:
thank you Bill, but I am inexperienced in vcscript not know adapt the code in this script.

VagnerOliveira


------------------------------------
Reply:
thank you jrv, but I am inexperienced in vcscript not know adapt the code in this script.

VagnerOliveira


------------------------------------
Reply:
thank you jrv, but I am inexperienced in vcscript not know adapt the code in this script.

VagnerOliveira

SCHTASKS is not VBScript.  Just read the help I posted and use it.

If you need a script written then you will need to hire a consultant to do it for you.  We do not write custom scripts or fix scripts found on the Internet.


\_(ツ)_/


------------------------------------

Powershell Check - AD Computer Management - Adding SCCM Computer Deletion

I created a powershell script a while back, all it does is runs two functions. One: to disable computers which, disables the computer account, moves the computer object to a different OU, updates the description, then creates a log for what's been moved (including if no computers were moved on the day of script execution. Two: Runs a scan on the DisabledOU (where computers were moved to from the first function) and deletes anything if it meets a criteria. Logs are also recorded including any security memberships in case we need to re-join. So far the script has worked well, logs everything and actions everything as expected.  If people come in after extended period of leave the Service Desk simply unlock the account, clear the description, and move the computer back in the appropriate OU.

What I'm trying to incorporate is to tack on the ability to delete the computer from SCCM also, since SCCM is set to discover only, it affects our compliance numbers for things like Windows updates.  I'm still not comfortable with my powershell level so I always like others to review it. And since not many use powershell in my organisation, internal resources are limited.

So yay or nay? I've tested the SCCM deletion part with a variable that only has one computer object and it seems to work. The original script works well as I mentioned. Thanks in advanced for any input, and any input would be greatly appreciated!

Original

# Disable-InactiveComputer function  Function Disable-InactiveComputer {    # Sets the log file name and format  $filePath2 = Get-Date -uformat ($folderPath + "Computer_Account_Disabled_on_%Y%m%d.csv")    # Sets the boundary OU to only search in Desktops and Laptops  $computerOUs=@(   'OU=Desktops,OU=Computers,OU=Department,DC=my,DC=lan',    'OU=Laptops,OU=Computers,OU=Department,DC=my,DC=lan'  )    # Builds an array of PC-* and LT-* computer objects from the Desktops and Laptops OU  $computers=foreach($ou in $ComputerOUs){   Get-ADComputer -Filter {   LastLogonDate -le $disableD -and PasswordLastSet -le $disableD -and (Name -like 'PC-*' -or Name -like 'LT-*') -and MemberOf -notlike 'CN=Loan Laptops,OU=Non-Standard Workstation Groups,OU=Resource,OU=Groups,OU=Department,DC=my,DC=lan' -and MemberOf -notlike 'CN=Training Room PCs,OU=Manual Install Applications,OU=Applications,OU=Groups,OU=Department,DC=my,DC=lan' -and MemberOf -notlike 'CN=GA Extended Offsite,OU=Non-Standard Workstation Groups,OU=Resource,OU=Groups,OU=Department,DC=my,DC=lan'  	} -SearchBase $ou -Properties *   }    # Debugging for an empty array, creates an appropriate .txt file  		If (!$computers){  			$NullDisable = Get-Date -uformat ($folderPath + "No_Disabled_Computers_on_%Y%m%d.txt")  			Write-Output "No computers were disabled." | Out-File -Append $NullDisable}  		Else {  		  # Action for each computer in the array - disables computer object, creates a description  # "Auto Disabled on Day, X Month Year", and moves computer object to the "Disabled Computer" OU  			Foreach($computer in $computers){  			Set-ADComputer $computer -Enabled $false -PassThru -Description "Auto Disabled on $(Get-Date -format 'D')" | Move-ADObject -TargetPath $disabledOU  			  # Collects Computer Name, Description, OS Version, SP Version, and Last Logon Date  # from the computer object to include in the log file in .csv format    			$cpt = Get-ADComputer $($computer.Name) -properties * | Sort-Object LastLogonDate -descending  				$props = @{  				'ComputerName'=$cpt.Name;  				'Description'=$cpt.Description;  				'OSVersion'=$cpt.OperatingSystem;  				'SPVersion'=$cpt.OperatingSystemServicePack;  				'LastLogonDate'=$cpt.LastLogonDate}  			$obj = New-Object -TypeName PSObject -Property $props  			$tobj += $obj  			}  			$tobj | Select-Object ComputerName, Description, OSVersion, SPVersion, LastLogonDate | Sort-Object Name | Export-Csv $filePath2 -NoTypeInformation  		}  }  		     # Delete-InactiveComputer function  Function Delete-InactiveComputer {    # Builds an array of PC-* and LT-* computer objects from the "Disabled Computers" OU only  $dComputers = Get-ADComputer -Filter {(Enabled -eq "False") -and (LastLogonDate -le $deleteD) -and (PasswordLastSet -le $deleteD) -and (Name -like 'PC-*' -or Name -like 'LT-*')} -SearchBase $disabledOU -Properties * | ?{$_.LastLogonDate -ne $null}    # Debugging for an empty array, creates an appropriate .txt file  	If (!$dComputers){  		$NullDelete = Get-Date -uformat ($folderPath + "No_Deleted_Computers_on_%Y%m%d.txt")  		Write-Output "No computers were deleted." | Out-File -Append $NullDelete}  	Else {    # Action for each computer in the array - deletes each computer  		Foreach ($dComputer in $dComputers){  		  # Sets the log file name and format, records names and types of security groups  # the computer object was a member of  			$filePath = Get-Date -uformat ($folderPath + $dComputer.Name + "_Deleted_on_%Y%m%d.csv")  			(Get-ADComputer $dComputer -Properties memberof).memberof `  			| Get-ADGroup `  			| Select-Object Name, Description, GroupCategory, GroupScope `  			| Export-Csv $filePath -NoTypeInformation  			Get-ADComputer $dComputer | Remove-ADComputer -confirm:$false  		}  	}  }    # =============================================================================  # SCRIPT BODY  # =============================================================================    # Import AD Module if required  if(@(Get-Module | Where-Object {$_.Name -eq "ActiveDirectory"} ).count -eq 0) {Import-Module ActiveDirectory}     # Set the log file location  $folderPath = "C:\Computer_Management\Logs\"    # Set the number of days for the disable inactive computer function to use as the computer age  $idays = 60    # Set the number of days for the delete inactive computer function to use as the computer age  $ddays = 120    # Set the date for the disable inactive comptuer function  $disableD = (Get-Date).AddDays(-($idays))    # Set the date for the delete inactive comptuer function  $deleteD = (Get-Date).AddDays(-($ddays))    # Set the OU locations as boundaries for this script to use  $desktopOU = "OU=Desktops,OU=Computers,OU=Department,DC=my,DC=lan"  $laptopOU = "OU=Laptops,OU=Computers,OU=Department,DC=my,DC=lan"  $disabledOU = "OU=Disabled Computers,DC=my,DC=lan"    # variable for holding computer information during the logging of function Disable-InactiveComputer  $tobj = @()    # Calls the "Disable-InactiveComputer" function.  Disable-InactiveComputer    # Calls the "Delete-InactiveComputer" function.  Delete-InactiveComputer  # =============================================================================  # END OF SCRIPT: [Computer Clean Up]  # =============================================================================

The deletion of Computers in SCCM is pretty straight forward, just two variables and an extra function in the Delete function, here's the code:

# Disable-InactiveComputer function  Function Disable-InactiveComputer {    # Sets the log file name and format  $filePath2 = Get-Date -uformat ($folderPath + "Computer_Account_Disabled_on_%Y%m%d.csv")    # Sets the boundary OU to only search in Desktops and Laptops  $computerOUs=@(   'OU=Desktops,OU=Computers,OU=Department,DC=my,DC=lan',    'OU=Laptops,OU=Computers,OU=Department,DC=my,DC=lan'  )    # Builds an array of PC-* and LT-* computer objects from the Desktops and Laptops OU  $computers=foreach($ou in $ComputerOUs){   Get-ADComputer -Filter {   LastLogonDate -le $disableD -and PasswordLastSet -le $disableD -and (Name -like 'PC-*' -or Name -like 'LT-*') -and MemberOf -notlike 'CN=Loan Laptops,OU=Non-Standard Workstation Groups,OU=Resource,OU=Groups,OU=Department,DC=my,DC=lan' -and MemberOf -notlike 'CN=Training Room PCs,OU=Manual Install Applications,OU=Applications,OU=Groups,OU=Department,DC=my,DC=lan' -and MemberOf -notlike 'CN=GA Extended Offsite,OU=Non-Standard Workstation Groups,OU=Resource,OU=Groups,OU=Department,DC=my,DC=lan'  	} -SearchBase $ou -Properties *   }    # Debugging for an empty array, creates an appropriate .txt file  		If (!$computers){  			$NullDisable = Get-Date -uformat ($folderPath + "No_Disabled_Computers_on_%Y%m%d.txt")  			Write-Output "No computers were disabled." | Out-File -Append $NullDisable}  		Else {  		  # Action for each computer in the array - disables computer object, creates a description  # "Auto Disabled on Day, X Month Year", and moves computer object to the "Disabled Computer" OU  			Foreach($computer in $computers){  			Set-ADComputer $computer -Enabled $false -PassThru -Description "Auto Disabled on $(Get-Date -format 'D')" | Move-ADObject -TargetPath $disabledOU  			  # Collects Computer Name, Description, OS Version, SP Version, and Last Logon Date  # from the computer object to include in the log file in .csv format    			$cpt = Get-ADComputer $($computer.Name) -properties * | Sort-Object LastLogonDate -descending  				$props = @{  				'ComputerName'=$cpt.Name;  				'Description'=$cpt.Description;  				'OSVersion'=$cpt.OperatingSystem;  				'SPVersion'=$cpt.OperatingSystemServicePack;  				'LastLogonDate'=$cpt.LastLogonDate}  			$obj = New-Object -TypeName PSObject -Property $props  			$tobj += $obj  			}  			$tobj | Select-Object ComputerName, Description, OSVersion, SPVersion, LastLogonDate | Sort-Object Name | Export-Csv $filePath2 -NoTypeInformation  		}  }  		     # Delete-InactiveComputer function  Function Delete-InactiveComputer {    # Variable for required SCCM details such as server host name and SCCM sitename  $SCCMServer = "SCCMServer.my.lan"  $sitename = "STN"    # Builds an array of PC-* and LT-* computer objects from the "Disabled Computers" OU only  $dComputers = Get-ADComputer -Filter {(Enabled -eq "False") -and (LastLogonDate -le $deleteD) -and (PasswordLastSet -le $deleteD) -and (Name -like 'PC-*' -or Name -like 'LT-*')} -SearchBase $disabledOU -Properties * | ?{$_.LastLogonDate -ne $null}    # Debugging for an empty array, creates an appropriate .txt file  	If (!$dComputers){  		$NullDelete = Get-Date -uformat ($folderPath + "No_Deleted_Computers_on_%Y%m%d.txt")  		Write-Output "No computers were deleted." | Out-File -Append $NullDelete}  	Else {    # Action for each computer in the array - deletes each computer  		Foreach ($dComputer in $dComputers){  		  # Sets the log file name and format, records names and types of security groups  # the computer object was a member of  			$filePath = Get-Date -uformat ($folderPath + $dComputer.Name + "_Deleted_on_%Y%m%d.csv")  			(Get-ADComputer $dComputer -Properties memberof).memberof `  			| Get-ADGroup `  			| Select-Object Name, Description, GroupCategory, GroupScope `  			| Export-Csv $filePath -NoTypeInformation  			Get-ADComputer $dComputer | Remove-ADComputer -confirm:$false  			  # Uses variable list from Foreach statement for identifying SCCM computer objects			  			$comp = gwmi -cn $SCCMServer -namespace root\sms\site_$($sitename) -class sms_r_system -filter "Name='$($dComputer)'"     # Delete the computer object from SCCM  				$comp.delete()  		}  	}  }    # =============================================================================  # SCRIPT BODY  # =============================================================================    # Import AD Module if required  if(@(Get-Module | Where-Object {$_.Name -eq "ActiveDirectory"} ).count -eq 0) {Import-Module ActiveDirectory}     # Set the log file location  $folderPath = "C:\Computer_Management\Logs\"    # Set the number of days for the disable inactive computer function to use as the computer age  $idays = 60    # Set the number of days for the delete inactive computer function to use as the computer age  $ddays = 120    # Set the date for the disable inactive comptuer function  $disableD = (Get-Date).AddDays(-($idays))    # Set the date for the delete inactive comptuer function  $deleteD = (Get-Date).AddDays(-($ddays))    # Set the OU locations as boundaries for this script to use  $desktopOU = "OU=Desktops,OU=Computers,OU=Department,DC=my,DC=lan"  $laptopOU = "OU=Laptops,OU=Computers,OU=Department,DC=my,DC=lan"  $disabledOU = "OU=Disabled Computers,DC=my,DC=lan"    # variable for holding computer information during the logging of function Disable-InactiveComputer  $tobj = @()    # Calls the "Disable-InactiveComputer" function.  Disable-InactiveComputer    # Calls the "Delete-InactiveComputer" function.  Delete-InactiveComputer  # =============================================================================  # END OF SCRIPT: [Computer Clean Up]  # =============================================================================

Again, any input would be greatly appreciated! Thank you!


  • Edited by ChinoZ32 Wednesday, September 16, 2015 1:52 AM
  • Changed type Bill_Stewart Monday, October 19, 2015 4:30 PM
  • Moved by Bill_Stewart Monday, October 19, 2015 4:30 PM This is not "someone debug/fix/rewrite long script for me" forum

Reply:

Does it work?


\_(ツ)_/


------------------------------------
Reply:

I just did. One computer was moved and disabled. Four computers were deleted. But I have eight instances of:

"

Method invocation failed because [System.Management.Automation.PSObject] does
not contain a method named 'op_Addition'.
At C:\Computer_Management\AD_Computer_Clean_Up_1.1.ps1:95 char:4
+             $tobj += $obj
+             ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (op_Addition:String) [], Runti
   meException
    + FullyQualifiedErrorId : MethodNotFound

"

and five instances of

"

You cannot call a method on a null-valued expression.
At C:\Computer_Management\AD_Computer_Clean_Up_1.1.ps1:145 char:5
+                 $comp.delete()
+                 ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

"

The deleted computers are still in SCCM. I shall investimagate further.


------------------------------------
Reply:

And what Is on line 95?


\_(ツ)_/


------------------------------------
Reply:

Line:

$cpt = Get-ADComputer $($computer.Name) -properties * | Sort-Object LastLogonDate -descending
$props = @{
'ComputerName'=$cpt.Name;
'Description'=$cpt.Description;
'OSVersion'=$cpt.OperatingSystem;
'SPVersion'=$cpt.OperatingSystemServicePack;
'LastLogonDate'=$cpt.LastLogonDate}
$obj = New-Object -TypeName PSObject -Property $props
$tobj += $obj
}
$tobj | Select-Object ComputerName, Description, OSVersion, SPVersion, LastLogonDate | Sort-Object Name | Export-Csv $filePath2 -NoTypeInformation


------------------------------------
Reply:

How is $tobj defined?


\_(ツ)_/


------------------------------------
Reply:

This line does not make any sense: $cpt = Get-ADComputer $($computer.Name) -properties * | Sort-Object LastLogonDate -descending


\_(ツ)_/


------------------------------------
Reply:

So here's essentially what you're asking:

Dear forum volunteers, here is a 240-line PowerShell script. Can someone please do the following:

1. Recreate a test environment, and

2. Add some feature for me or fix some elusive bug for me

To get free help, you need to make it as easy as possible for others to help you. Posting a 240-line script and asking volunteers to add some feature or fix some bug for you is beyond the scope of this forum.


-- Bill Stewart [Bill_Stewart]


------------------------------------
Reply:

So here's essentially what you're asking:

Dear forum volunteers, here is a 240-line PowerShell script. Can someone please do the following:

1. Recreate a test environment, and

2. Add some feature for me or fix some elusive bug for me

To get free help, you need to make it as easy as possible for others to help you. Posting a 240-line script and asking volunteers to add some feature or fix some bug for you is beyond the scope of this forum.


-- Bill Stewart [Bill_Stewart]

Thanks Bill, that's precisely what I asked for. Thank you accurately clarifying what I've asked for, congratulations.

  • Edited by ChinoZ32 Wednesday, September 16, 2015 10:11 PM

------------------------------------
Reply:

This line does not make any sense: $cpt = Get-ADComputer $($computer.Name) -properties * | Sort-Object LastLogonDate -descending


\_(ツ)_/

Hmmm, which part? The $($computer.Name)?


You don't need this $().  Sort-Object ??? There is only one record. How can you sort one thing?

What I see is that you have a beginning knowledge of PS but seem too have copied and pasted bits without thinking.  There is no checking for errors and no testing to see if a return is null. I suspect your error is due to this issue.


\_(ツ)_/


------------------------------------
Reply:

How is $tobj defined?


\_(ツ)_/

Yeah that doesn't make sense too. As I said I'm fairly new. The way I understand it is that everything that was collected by $props, it stores it in $tobj in a table format and creates the values to "Computer_Account_Disabled_on_%Y%m%d.csv". It reruns that for every $computer in $computers.

Edit:

I've reran again today and it ran error free. And I had 1 computer object disabled, and 2 computer objects deleted. All log files created. I'm a bit stumped. I'll have to re-run again in a few days or in a week so there are objects the script can actually manipulate. Thanks again for your help, I'll use that time to troubleshoot. Initially I thought I have to use $Variable = @() but from how it ran just now it had no troubles running. 

  • Edited by ChinoZ32 Wednesday, September 16, 2015 10:11 PM

------------------------------------
Reply:

This line does not make any sense: $cpt = Get-ADComputer $($computer.Name) -properties * | Sort-Object LastLogonDate -descending


\_(ツ)_/

Hmmm, which part? The $($computer.Name)?

------------------------------------
Reply:
Thanks Bill, that's precisely what I asked for. Thank you accurately clarifying what I've asked for, congratulations.

Ultimately it's about fairness. Keep in mind that the respondents who answer questions here are volunteers. What you are asking for is essentially free consulting work. jrv has thus far tried to help but it's not the purpose of the forum to fix or redesign long scripts to spec.


-- Bill Stewart [Bill_Stewart]


------------------------------------

Split and join with leading zeros

Hi All,

I am a little bit struggling with splitting and joining an IP address. What I want to do for practice is to split an IP address (for example: 10.0.101.23) split it in 4 parts. Take the last 3 parts and at leading zeros for each part to have a total of 9 numbers. For the example this would be 000101023. I know how I can split. How I can add leading zeros and how to join. But not how to use this is an effective way together.

The parts I have:

$IP = "10.0.101.23"
$IPS = $IP.Split(".")
$IPS =  "$($IPS[1])$($IPS[2])$($IPS[3])"

$a.ToString("000") <- Not working because it is not a string. Do I need to create an array?

Thanks, Bart


Reply:
-join(('10.0.101.23' -split '\.')[1..3] | % {$_.padleft(3,'0')})

so, split on period. select 2 through 4th items from the split [1..3], pipe each item to foreach where we do padleft which if the string is less than 3 characters it adds the specified character to left until it is 3 in length. wrap it all in parenthesis so it executes as a whole then join.

Easier to read version which may be more helpful for understanding:

$Split = ('10.0.101.23' -split '\.')[1..3]     $Octets = Foreach ($octect in $split)  {   $octect.padleft(3,'0')  }    -join $Octets



SingleHop: A leader in Managed Azure

  • Edited by Noah Sparks Wednesday, September 16, 2015 8:28 PM

------------------------------------
Reply:
Damn...that was easy. Thanks. I learned a lot from your example.

------------------------------------
Reply:

here is a variation that does not need a regular expression

-join ('10.0.101.23'.split('.')[1,2,3] | %{$_.padleft(3,'0')})


------------------------------------

Want to test using Work Folders with data on NAS?

Hi, I'm from the Work Folders team in Microsoft. In discussions with customers, I've learnt that some people want to keep their user data on the NAS devices.

We'd like to validate some design thinking on supporting this scenario. If you are interested, please ping me offline at jianyan at microsoft to engage.

Thank!

Jane

.vbs file not running anymore

I create a .vbs script in another software SAS, that had been running successfully for years.  I believe a recent Windows Update that our Company sent out has changed some security settings relating to running .vbs scripts especially this one I created which runs successfully on other peoples computers but not mine.  The vbscript opens up excel, then one by one opens all .xml files found in a folder, saves them as .xlsx files, deletes the xml files, and then deletes itself.  The error message I get when the script gets to the line where it fails is: Set oXL = CreateObject("Excel.Application").  The error returned is "The specified procedure could not be found."  The code is 8007007F.  I assume there is something in the registry that has turned off opening excel via a vbs file but I cannot find anything in an exhaustive search that exactly matches my issue.  Any help is appreciated.

WCC

  • Changed type Bill_Stewart Monday, October 19, 2015 4:29 PM
  • Moved by Bill_Stewart Monday, October 19, 2015 4:29 PM This is not a support forum for third-party software

Reply:

This is not a scripting issue. It cannot be resolved with a script.

I suggest contacting your admins to help you et the resources you need.


\_(ツ)_/


------------------------------------
Reply:
They are no help.

WCC


------------------------------------
Reply:

You have something broken on your system that we cannot find or fix from afar, sight unseen, in a forum.

You will need to hire a consultant or contact Microsoft support.


-- Bill Stewart [Bill_Stewart]


------------------------------------
Reply:
You say the script runs, but errors out when trying to open Excel.  This leads me to believe it is not a security issue regarding running VBscript, but an issue with Excel itself.  Try reinstalling MSOffice and go from there.

Rich Prescott | Infrastructure Architect, Windows Engineer and PowerShell blogger | MCITP, MCTS, MCP

Engineering Efficiency
@Rich_Prescott
Windows System Administration tool
AD User Creation tool


------------------------------------

How to add a new user in MDS if another computer with the same name exists in the same domain?

Hi,

While adding a new user in User and Group Permissions,I found this issue.

If the User Name and any other computer name in the same domain is same while adding a user to MDS, it adds a $ sign to the name and takes that other computer name instead of the user.


Reply:
anyone know about this is this the limitation with MDS ?

------------------------------------
Reply:

I think it is fixed in SQL14 RTM CU8 or SQL14 SP1 CU1


------------------------------------
Reply:
Thanks for the reply we are still on SQL14 CU5 do you know of any work around ?

------------------------------------
Reply:

If you are not willing to apply the new CU, then the only workaround is modify the database manually.

You have to find sid of the user, in some way like

http://pcsupport.about.com/od/registry/ht/find-user-security-identifier.htm

SELECT TOP 1000 *   FROM [MDM_Sample].[mdm].[tblUser]     UPDATE [tblUser]   SET [SID] = N'newsid'   WHERE ID = x


------------------------------------

When exporting Outlook Email subject to an excel file the data in the spreadsheet seams to have been sorted

When exporting Outlook Email subject to an excel file the data in the spreadsheet seams to have been sorted when in Office 2003 it ws like for like.

As the start of the Subject is "1,dd/mm/yyyy" it opens in Excel in the lowest date format ?

SharePoint Developer & Administration interview

Can you please send me the questions to expect in an interview for sharepoint.

please send to tshivhenga85@gmail.com


Reply:

------------------------------------

Redirecting from Inofpath Formon submit with SharePoint 2013

Hello guys,

I have an Infopath Form and I would like to redirect to a specific site after submitting the Form to a specific location, but I alsways get an error message and it won't redirecting. What can I do?

Best regards

Matthias


Reply:

Hi, and what error message you have there? I think that best way is to make submit button in form and on that button apply rules (submit, close, redirect), or just submit and redirect

Roman


Roman Nedzelsky


------------------------------------
Reply:

Hello,

As Roman Described you should configure submit button properties otherwise you have to do in programmatically adding custom action to submit button

here is an example but I am not sure this is the same in 2013

Custom Submit button


------------------------------------

SSRS Import reports from MS Access

When importing reports from MS Access, I get the following error:

"An error occurred while the report was being imported: item has already been added."

It then lists the field that is already present in the dataset.

Searching on the Internet for a solution said that the problem was that the field name is being listed more than once in the dataset. This didn't make any sense to me, as the dataset is a view, and there are no duplicate entries for the field that it was having a problem with.

When I took a look at the MS Access report, I realised that the field that it was having a problem with was a combo box in the report. The combo was taking the Primary Key value and looking up the value to display. When I deleted the combo box, it then said there was a problem with the next field which was also a combo box. When I deleted all combo boxes, the report imported.

So the problem is with the fact that in Access you can lookup the value to display using a combo.

So the problem now is that I need to go into Access and re-design the reports so that the underlying data source fixes up the looking up of data. This is quite a lot of work, considering that there over 300 reports I need to do this with, so I would like to find out if there is another way to do this. Is there a way for the import to work on these combo box fields?


Reply:

Robert,

It would appear that what you are experiencing is expected behavior...

"If you import a report that has a query that contains query parameters, the query will not be converted when the report is imported. To import the query with the report, temporarily replace the query parameters in the Access report with hard-coded values, and then replace them with query parameters after the report is imported."

https://technet.microsoft.com/en-us/library/ms157205(v=sql.105).aspx

That being said, what you are having to look for now is a way to address the controls in an automated fashion.  The best I can come up with is to write a Visual Basic script in Access to try and modify the controls... see link below...

http://www.tek-tips.com/viewthread.cfm?qid=1054470

If this doesn't help I think your question might be better served in a Microsoft Access forum.


  • Edited by JJordheim Wednesday, September 16, 2015 1:37 PM

------------------------------------

Exceptions to Restrict Formatting and Editing lookup against AD

When attempting to add users to the Exceptions for the Restrict Formatting and Editing option in Word 2007, we receive the following error: "Some of the users you have entered could not be added to the list because their names could not be verified." Depending on the how the username is entered, domainname\username or username@domainname it works under my user account. However, other staff members that are in different OU's are not able to add exceptions. I have local admin rights on my PC and as a test, we gave another user local admin rights and they were still unable to add users to the exception list.

Our domain controllers are running Server 2003, R2, SP2. The local PC's are running XP, SP3 with Office 2007.

  • Changed type Bruce-Liu Tuesday, June 15, 2010 7:39 AM

Reply:

Hello,

can you describe the way to edit this setting, i've tried to find it via Word/Office 2007 GPO settings and also local with Word 2007 but can't find it.


Best regards Meinolf Weber Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

------------------------------------
Reply:

From Word, click Review, then Protect document, then Restrict Formattting and Editing.

Check the box for option 2, then under Exceptions, click the More users link.

This opens a dialog box that allows you to enter mutiple users that will have permissions to Edit the document.


------------------------------------
Reply:

Hello,

i didn't forget you, unfortunal [well not for me:-)] i can go on testing not earlier as on monday. Don't have access to my lab system before.


Best regards Meinolf Weber Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

------------------------------------
Reply:

Hello,

i am able to reproduce your problem within Office 2003 / 2007 and 2010 on Windows XP SP3, Windows 7 and Windows server 2003 R2 as Terminal server.

Unfortunal i have no idea what's going on. I have the same problem working as domain user or Administrator. Doesn't matter if groups or user accounts are choosen.

Also i tested i on 3 different forest/domains all with the same result some work, some not.

I am trying to get in contact with some Office people about this.


Best regards Meinolf Weber Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

------------------------------------
Reply:

Hello,

Did anyone find a resolution to this issue as i'm now trying to use this feature with a few staff and we're finding the same od behaviour.

As an admin i'm finding it a bit flacky but as a standard users it's just all over the show. Some users work, some don't just a pain really.

Look forward to seeing an update.

Regards Dave Webster 


------------------------------------
Reply:

Hi Meinolf

We are experiencing the exact same problem on Word 2013 and cannot find a solution anywhere.  Were you able to find out what caused this?  It works fine on our domain, but on a clients domain we get exactly the same bahavior. We dont know what to tell them to look at. Please help! PS: It work on their domain on Word 2010 but not Word 2013.

You can add local domain accounts, but you cannot add external email addresses.

Kind Regards

Stephan


  • Edited by Stephan Roux Wednesday, September 16, 2015 12:13 PM

------------------------------------

WSUS Windows 10 Setup

Is it possible to setup windows 10 as a WSUS Replica Server to push updates to clients? If so please advise on how to set this up.

Management software to administer several radius server?

Hello,

is there any software or build in solution in server 2012r2 to administer several NPS in Windows Server2012R2? Right now we have to enter every device and rule change in several servers (the local server as well as a general standby NPS in our central datacenter).

Is there a solution where you have a central configuration solution?

Importing and exporting is not really working, as every NPS configuration is unique.

Any ideas or hints?

Thanks a lot

Jan


Reply:

Perhaps Powershell is the right tool to configure more servers at the same time.

For ideas look here

https://technet.microsoft.com/en-us/library/jj872739.aspx

HTH

Milos


------------------------------------

No comments:

Post a Comment

Setup is Split Across Multiple CDs

Setup is Split Across Multiple CDs Lately I've seen a bunch of people hitting installation errors that have to do with the fact th...